Android: better flags, tags loading feedback

This commit is contained in:
jendib 2014-11-25 00:09:12 +01:00
parent a6c123ad03
commit a84748f075
10 changed files with 35 additions and 5 deletions

View File

@ -20,12 +20,10 @@ public class MainApplication extends Application {
JSONObject json = PreferenceUtil.getCachedJson(getApplicationContext(), PreferenceUtil.PREF_CACHED_USER_INFO_JSON);
ApplicationContext.getInstance().setUserInfo(getApplicationContext(), json);
// TODO Edit sharing
// TODO Tags loading feedback
// TODO Redraw flags
// TODO Error feedback (all REST request, even login)
// TODO Fullscreen preview
// TODO Caching preferences
// TODO Edit sharing
super.onCreate();
}

View File

@ -78,10 +78,14 @@ public class MainActivity extends ActionBarActivity {
// Get tag list to fill the drawer
final ListView tagListView = (ListView) findViewById(R.id.tagListView);
final View tagProgressView = findViewById(R.id.tagProgressView);
final View tagEmptyView = findViewById(R.id.tagEmptyView);
tagListView.setEmptyView(tagProgressView);
TagResource.stats(this, new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
tagListView.setAdapter(new TagListAdapter(response.optJSONArray("stats")));
tagListView.setEmptyView(tagEmptyView);
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

View File

@ -18,6 +18,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:orientation="vertical"
android:clickable="true"
android:background="#fff"
android:elevation="5dp">
@ -143,6 +144,32 @@
android:divider="@android:color/transparent"
android:dividerHeight="0dp"/>
<RelativeLayout
android:id="@+id/tagProgressView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ProgressBar
style="?android:progressBarStyle"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"/>
</RelativeLayout>
<TextView
android:id="@+id/tagEmptyView"
android:visibility="gone"
android:padding="12dp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="@string/no_tags"
android:textSize="14sp"/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>

View File

@ -25,7 +25,9 @@
<string name="downloading_document">Downloading document</string>
<string name="action_search">Search documents</string>
<string name="all_documents">All documents</string>
<string name="shared_documents">Shared documents</string>
<string name="all_tags">All tags</string>
<string name="no_tags">No tags</string>
<!-- Validation -->
<string name="validate_error_email">Invalid email</string>
@ -33,6 +35,5 @@
<string name="validate_error_length_max">Too long (max. %d)</string>
<string name="validate_error_required">Required</string>
<string name="validate_error_alphanumeric">Only letters and numbers</string>
<string name="shared_documents">Shared documents</string>
</resources>