Coding

Blogging: Windows Live Writer

I have started to use Windows Live Writer for my blogging.

A wonderful tool to do offline blogging and cross posting to

multiple blogs. Live Writer handles all the common blog sites and tools.

Live writer has a large number of plugins that easily can be deployed.

So far I can recommend the following plugins:

For cross posting:

http://xpollinate.codeplex.com/

For code samples:
http://www.amergerzic.com/post/WLWSourceCodePlugin.aspx

[sourcecode language=”java”]
package se.lightsoft.common.gui;

import android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

public class Toolbar extends LinearLayout {

public Toolbar(final Context context) {
super(context);
}

public Toolbar(final Context con, AttributeSet attrs) {
super(con,attrs);
setOrientation(HORIZONTAL);
setBackgroundColor(getResources().
getColor(android.R.color.transparent));

LayoutInflater inflater = (LayoutInflater)
con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.navigation, this);

TypedArray a = con.obtainStyledAttributes(attrs,
R.styleable.Toolbar);
String option = a.getString(R.styleable.Toolbar_textViewId);

String resourceId = “se.lightsoft.demo:id/”+option;
int optionId = getResources().getIdentifier(resourceId,null,null);
TextView currentOption = (TextView) findViewById(optionId);
currentOption.setBackgroundColor(getResources().
getColor(android.R.color.white));
currentOption.setTextColor(getResources().
getColor(android.R.color.black));
currentOption.requestFocus(optionId);
currentOption.setFocusable(false);
currentOption.setClickable(false);

// TextView option1 = (TextView) findViewById(R.id.option1);
// option1.setOnClickListener(new OnClickListener() {
// public void onClick(View v) {
// CharSequence txt = “Hello!”;
// int len = Toast.LENGTH_SHORT;
// Toast toast = Toast.makeText(con, txt, len);
// toast.show();
// }
// });
}
}
[/sourcecode]

Leave a Reply

Your email address will not be published. Required fields are marked *