Skip to content

Commit

Permalink
bump to 1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
suwhs committed Sep 21, 2015
1 parent f7fc704 commit 39d93a4
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "su.whs.watl.samples"
minSdkVersion 9
targetSdkVersion 21
versionCode 4
versionName "1.1.4"
versionCode 5
versionName "1.1.5"
signingConfig signingConfigs.config
}
buildTypes {
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/assets/about.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<html>
<body>
<center><h3>About wATL Demo App</h3></center>
<center><h3>About<br/> wATL Demo App</h3></center>
<p><center><img src="logo.png"/></center></p>
<p>
<right>version 1.1.4</right>
<right>version 1.1.5</right>
</p>
<p>
<center><h2>Welcome!</h2></center>
Expand All @@ -15,14 +15,18 @@
<li>image wrap</li>
<li>hyphenation supports</li>
<li>supports animation DynamicDrawableSpan</li>

<li>experimental support for bidirectional text</li>
<li>pagination adapter</li>
</ul>
</p>
<!-- <rtl>sample of RTL text <ltr>and LTR within</ltr> 1234567890</rtl> -->
<br/>
<br/>
<right><p><a href="http://whs.su/?p=33">wATL Home</a></p></right>
<br/>
<right><p><a href="mailto:[email protected]">[email protected]</a></p></right>
<right>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
</right>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected Drawable readFullDrawable() {
if (mFullVersionLoaded) return null;
try {
/* GifDrawable implements Animatable, so we can show animations */
Drawable r = Build.VERSION.SDK_INT>18 ? new GifDrawable(mContext.getAssets().open(mPath)) : new GifDrawableCompat(mContext.getAssets().open(mPath));
Drawable r = Build.VERSION.SDK_INT > 18 ? new GifDrawable(mContext.getAssets().open(mPath)) : new GifDrawableCompat(mContext.getAssets().open(mPath));
mFullVersionLoaded = true;
return r;
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/su/whs/watl/samples/ContentLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void deserialize(Context context, ArticleView view) throws SpannedSerial
public void load(final Context context, ArticleView view) throws Exception {
final String content;
final Html.ImageGetter imageGetter;
if (isSerialized(context,mUuid)) {
if (wATLApp.serializationEnabled && isSerialized(context,mUuid)) {
try {
deserialize(context, view);
return;
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/su/whs/watl/samples/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {
data.add(getRowData(5));
data.add(getRowData(6));
data.add(getRowData(7));
data.add(getRowData(8));
SimpleAdapter adapter = new SimpleAdapter(this,data,R.layout.samples_list_item, new String[] {
"img", "title", "description"
}, new int[] { R.id.imageView, R.id.itemTitle, R.id.itemSnippet }) {
Expand Down Expand Up @@ -89,6 +90,9 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
case 7:
i.setClass(getBaseContext(), RTLTestActivity.class);
break;
case 8:
i.setClass(getBaseContext(), AboutActivity.class);
break;
default:
return;
}
Expand Down Expand Up @@ -156,6 +160,11 @@ private Map<String,Object> getRowData(int index) {
description = "test Right-To-Left direction";
img = R.mipmap.ic_real;
break;
case 8:
title = "About";
description = "";
img = R.mipmap.ic_logo;
break;
}
result.put("img",img);
result.put("title",title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import su.whs.watl.ui.MultiColumnTextViewEx;

public class ViewPagerActivity extends ActionBarActivity implements ViewPager.OnPageChangeListener {
private boolean mFullscreenMode = true;
private boolean mFullscreenMode = false;
private ViewPager mPager;
private SparseArray<String> mArticles;
private Map<String,String> mTitles = new HashMap<String,String>();
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/java/su/whs/watl/samples/wATLApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
public class wATLApp extends Application {
private boolean hyphenatorReady = false;
public static boolean serializationEnabled = false;
private ContentLoader contentLoader = new ContentLoader();

public interface StateListener {
Expand Down Expand Up @@ -80,12 +81,14 @@ protected void onPostExecute(Void params) {
// long spent = SystemClock.uptimeMillis() - start;
// Log.e("APP:PERF", "100 loads: "+String.valueOf(spent)+" ms");
// start = SystemClock.uptimeMillis();
contentLoader.cacheArticleAsSerializedSpanned(getApplicationContext(), new Runnable() {
@Override
public void run() {
Log.d("wATLApp", "serialization finished");
}
});
if (serializationEnabled) {
contentLoader.cacheArticleAsSerializedSpanned(getApplicationContext(), new Runnable() {
@Override
public void run() {
Log.d("wATLApp", "serialization finished");
}
});
}
// spent = SystemClock.uptimeMillis() - start;
// Log.e("APP:PERF", "caching time spent: " + String.valueOf(spent) + " ms");
// start = SystemClock.uptimeMillis();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="su.whs.watl.samples.MultiColumnTextViewExActivity">

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/scrollView2" >

<su.whs.watl.ui.MultiColumnTextViewEx
android:id="@+id/textView"
android:text="@string/hello_world"
app:textPaddingLeft="5dp"
app:textPaddingRight="5dp"
app:textPaddingTop="5dp"
app:textPaddingBottom="5dp"
app:asyncReflow="false"
app:columnCount="3"
app:columnSpacing="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
app:textPaddingTop="5dp"
app:textPaddingBottom="5dp"
app:asyncReflow="false"
app:columnCount="3"
app:columnCount="2"
app:columnSpacing="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_text_view_ex_scroll.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:asyncReflow="false"
app:asyncReflow="true"
app:justificationEnabled="true"
app:selectionColor="@color/accent_material_light"
app:paragraphMarginTop="8dp"
Expand Down

0 comments on commit 39d93a4

Please sign in to comment.