Skip to content

Commit 7520a06

Browse files
updated sdk and added RecyclerView sample (available via the menu).
1 parent 84091f0 commit 7520a06

File tree

16 files changed

+310
-217
lines changed

16 files changed

+310
-217
lines changed

.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.idea/gradle.xml

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.example.autofittextviewsample"
4-
android:installLocation="auto"
5-
>
2+
<manifest package="com.example.autofittextviewsample"
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:installLocation="auto">
65

76
<application
87
android:allowBackup="true"
98
android:icon="@drawable/ic_launcher"
109
android:label="@string/app_name"
11-
android:theme="@android:style/Theme.Holo.Light" >
10+
android:theme="@style/Theme.AppCompat.Light">
1211
<activity
13-
android:name="com.example.autofittextviewsample.MainActivity"
14-
android:label="@string/app_name" >
12+
android:name=".MainActivity"
13+
android:label="@string/app_name">
1514
<intent-filter>
16-
<action android:name="android.intent.action.MAIN" />
15+
<action android:name="android.intent.action.MAIN"/>
1716

18-
<category android:name="android.intent.category.LAUNCHER" />
17+
<category android:name="android.intent.category.LAUNCHER"/>
1918
</intent-filter>
2019
</activity>
20+
<activity android:name=".Main2Activity">
21+
</activity>
2122
</application>
2223

23-
</manifest>
24+
</manifest>

AutoFitTextViewSample/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ android {
3333

3434
dependencies {
3535
compile fileTree(dir: 'libs', include: ['*.jar'])
36-
36+
compile 'com.android.support:appcompat-v7:24.1.1'
37+
compile 'com.android.support:recyclerview-v7:24.1.1'
3738
compile project(':AutoFitTextViewLibrary')
3839
}
Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
android:layout_width="match_parent"
4-
android:layout_height="match_parent"
5-
tools:context=".MainActivity" >
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
tools:context=".MainActivity">
66

77
<RelativeLayout
88
android:id="@+id/parametersContainer"
99
android:layout_width="match_parent"
1010
android:layout_height="wrap_content"
1111
android:columnCount="2"
1212
android:orientation="horizontal"
13-
android:padding="4dp" >
13+
android:padding="4dp">
1414

1515
<EditText
1616
android:id="@+id/contentEditText"
@@ -22,15 +22,15 @@
2222
android:layout_gravity="fill_horizontal"
2323
android:ems="10"
2424
android:hint="content"
25-
android:text="content text sample" />
25+
android:text="content text sample"/>
2626

2727
<Button
2828
android:id="@+id/minusLineCountButton"
2929
android:layout_width="wrap_content"
3030
android:layout_height="wrap_content"
3131
android:layout_below="@+id/contentEditText"
3232
android:layout_toRightOf="@+id/textView2"
33-
android:text="-" />
33+
android:text="-"/>
3434

3535
<TextView
3636
android:id="@+id/linesCountTextView"
@@ -41,53 +41,43 @@
4141
android:layout_toRightOf="@+id/minusLineCountButton"
4242
android:paddingLeft="10dp"
4343
android:paddingRight="10dp"
44-
android:text="2" />
44+
android:text="2"/>
4545

4646
<Button
4747
android:id="@+id/plusLineCountButton"
4848
android:layout_width="wrap_content"
4949
android:layout_height="wrap_content"
5050
android:layout_below="@+id/contentEditText"
5151
android:layout_toRightOf="@+id/linesCountTextView"
52-
android:text="+" />
52+
android:text="+"/>
5353

5454
<TextView
5555
android:id="@+id/textView1"
5656
android:layout_width="wrap_content"
5757
android:layout_height="wrap_content"
5858
android:layout_alignParentLeft="true"
59-
android:layout_alignRight="@+id/minusLineCountButton"
60-
android:layout_alignTop="@+id/widthSeekBar"
59+
android:layout_below="@id/textView2"
6160
android:text="width:"
62-
android:textSize="20dp" />
61+
android:textSize="20dp"/>
6362

6463
<SeekBar
6564
android:id="@+id/widthSeekBar"
6665
android:layout_width="match_parent"
6766
android:layout_height="wrap_content"
67+
android:layout_alignBottom="@+id/textView1"
6868
android:layout_below="@+id/minusLineCountButton"
69-
android:layout_toRightOf="@+id/TextView01"
69+
android:layout_toRightOf="@+id/textView1"
7070
android:max="100"
71-
android:progress="50" />
71+
android:progress="50"/>
7272

7373
<TextView
7474
android:id="@+id/TextView01"
7575
android:layout_width="wrap_content"
7676
android:layout_height="wrap_content"
7777
android:layout_alignParentLeft="true"
78-
android:layout_alignTop="@+id/heightSeekBar"
78+
android:layout_below="@+id/textView1"
7979
android:text="height:"
80-
android:textSize="20dp" />
81-
82-
<SeekBar
83-
android:id="@+id/heightSeekBar"
84-
android:layout_width="wrap_content"
85-
android:layout_height="wrap_content"
86-
android:layout_alignParentRight="true"
87-
android:layout_below="@+id/widthSeekBar"
88-
android:layout_toRightOf="@+id/TextView01"
89-
android:max="100"
90-
android:progress="50" />
80+
android:textSize="20dp"/>
9181

9282
<TextView
9383
android:id="@+id/textView2"
@@ -97,7 +87,20 @@
9787
android:layout_alignParentLeft="true"
9888
android:layout_alignTop="@+id/minusLineCountButton"
9989
android:gravity="center_vertical"
100-
android:text="max lines count:" />
90+
android:text="max lines count:"/>
91+
92+
<SeekBar
93+
android:id="@+id/heightSeekBar"
94+
android:layout_width="wrap_content"
95+
android:layout_height="wrap_content"
96+
android:layout_alignBottom="@+id/TextView01"
97+
android:layout_alignParentEnd="true"
98+
android:layout_alignParentRight="true"
99+
android:layout_below="@+id/widthSeekBar"
100+
android:layout_toEndOf="@+id/TextView01"
101+
android:layout_toRightOf="@+id/TextView01"
102+
android:max="100"
103+
android:progress="50"/>
101104
</RelativeLayout>
102105

103106
<FrameLayout
@@ -106,7 +109,7 @@
106109
android:layout_height="match_parent"
107110
android:layout_alignParentBottom="true"
108111
android:layout_below="@+id/parametersContainer"
109-
android:background="#ffff0000" >
112+
android:background="#ffff0000">
110113
</FrameLayout>
111114

112-
</RelativeLayout>
115+
</RelativeLayout>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout
3+
android:id="@+id/activity_main2"
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
xmlns:tools="http://schemas.android.com/tools"
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:paddingBottom="@dimen/activity_vertical_margin"
9+
android:paddingLeft="@dimen/activity_horizontal_margin"
10+
android:paddingRight="@dimen/activity_horizontal_margin"
11+
android:paddingTop="@dimen/activity_vertical_margin"
12+
tools:context="com.example.autofittextviewsample.Main2Activity">
13+
14+
<android.support.v7.widget.RecyclerView
15+
android:layout_width="match_parent" android:id="@android:id/list"
16+
android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
17+
18+
</RelativeLayout>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="match_parent"
5+
android:layout_height="50dp">
6+
7+
<com.lb.auto_fit_textview.AutoResizeTextView
8+
android:id="@android:id/text1"
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent"
11+
android:gravity="center_vertical"
12+
android:text="hi"
13+
android:textSize="1000dp"/>
14+
</FrameLayout>
Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<menu xmlns:android="http://schemas.android.com/apk/res/android">
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto">
34

4-
<item android:icon="@android:drawable/ic_menu_info_details"
5-
android:title="@string/more_info" android:showAsAction="always">
6-
<menu>
7-
<group android:menuCategory="container"
8-
android:checkableBehavior="none">
9-
<item android:id="@+id/menuItem_current_repository_website"
10-
android:title="@string/repository_website"></item>
11-
<item android:id="@+id/menuItem_all_my_repositories"
12-
android:title="@string/all_my_repositories"></item>
13-
<item android:id="@+id/menuItem_all_my_apps"
14-
android:title="@string/all_my_apps"></item>
15-
</group>
16-
</menu>
17-
</item>
5+
<item
6+
android:icon="@android:drawable/ic_menu_info_details"
7+
android:title="@string/more_info"
8+
app:showAsAction="always">
9+
<menu>
10+
<group
11+
android:checkableBehavior="none"
12+
android:menuCategory="container">
13+
<item
14+
android:id="@+id/menuItem_show_recyclerViewSample"
15+
android:title="show RecyclerView sample"/>
16+
<item
17+
android:id="@+id/menuItem_current_repository_website"
18+
android:title="@string/repository_website"></item>
19+
<item
20+
android:id="@+id/menuItem_all_my_repositories"
21+
android:title="@string/all_my_repositories"></item>
22+
<item
23+
android:id="@+id/menuItem_all_my_apps"
24+
android:title="@string/all_my_apps"></item>
25+
</group>
26+
</menu>
27+
</item>
1828

19-
</menu>
29+
</menu>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>

0 commit comments

Comments
 (0)