суббота, 22 декабря 2012 г.

Dark theme for Eclipse

There is a nice dark theme for Eclipse IDE located here. It is very simple to install it.
For true coders only :)


[Edit]
Found another site with a big collection of perfect themes located here.

понедельник, 17 декабря 2012 г.

ExpandableTextView

Custom android widget.
By default it contains only 3 lines of text and is collapsed. If text is much more, than it will be ellipsized at the end.
By tapping on it, text will expand to it`s full size with alpha animation.

Using:
via xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" xmlns:expandable="http://schemas.android.com/apk/res/com.example.expandable_text">

<ru.gang018.expandabletextview.ui.ExpandableTextView
    android:id="@+id/expand"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    expandable:textToExpand="@string/app_name"
    expandable:textSize="14sp"
    expandable:textColor="@android:color/darker_gray"
    expandable:linesCountWhenExpand="4"/>

</RelativeLayout>

via code
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final ExpandableTextView tv = new ExpandableTextView(getApplicationContext());
    tv.setText("aadfdsfasasdfadsfdfsfdsfadsfdasfadsfdsafasdfdsfasdfdsafasdfdsafasdfsadfsdfsadfsafasdfsdfafsadfsadfsadfdsafadfsadfsdafdafasdfsdafsdafsdfafsadfafsadfaafs");
    tv.setTextColor(Color.BLUE);
    tv.setTextSize(20);
    tv.setMinLinesCount(2);
    this.addContentView(tv, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
}

Sources can be downloaded here