Junior Android Developer
Some pages about android developers tools I use.
суббота, 22 декабря 2012 г.
понедельник, 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
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
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
@Overridexmlns: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
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
пятница, 23 ноября 2012 г.
My Android apps
A simple little app which works with your battery charge.
Funny stories from killmepls.ru. Only Russian language is available.
Connect Sony Xperia S to Mac OS
A few time ago I had a new Mac at my workplace, so a faced the problem how to connect my phone to it. After googling I found this and it helps me a lot.
Подписаться на:
Сообщения (Atom)