Add in the ProgressWheel!

Also make sure it gets put in the proper package to make sure the author gets credit.
ugly-unit-test
Bradlee Speice 2014-05-17 01:37:44 -04:00
parent 5222b6e3e6
commit b04d6c67ae
4 changed files with 27 additions and 6 deletions

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp" >
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
@ -39,4 +40,13 @@
android:id="@+id/download_ibtn_download"
style="@style/AppBaseTheme.Borderless" />
<com.todddavies.components.progressbar.ProgressWheel
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:visibility="gone"
android:id="@+id/download_prg_download"
app:rimWidth="0dp"
app:barWidth="4dp" />
</RelativeLayout>

View File

@ -1,4 +1,4 @@
package org.bspeice.minimalbible;
package com.todddavies.components.progressbar;
import android.content.Context;
import android.content.res.TypedArray;
@ -12,6 +12,8 @@ import android.os.Message;
import android.util.AttributeSet;
import android.view.View;
import org.bspeice.minimalbible.R;
/**
* An indicator of progress, similar to Android's ProgressBar.

View File

@ -5,15 +5,12 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.IconButton;
import android.widget.IconTextView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.joanzapata.android.iconify.Iconify;
import com.todddavies.components.progressbar.ProgressWheel;
import org.bspeice.minimalbible.R;
import org.crosswire.jsword.book.Book;
@ -21,6 +18,7 @@ import java.util.List;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
/**
* Adapter to inflate list_download_items.xml
@ -69,6 +67,7 @@ public class BookListAdapter extends BaseAdapter {
@InjectView(R.id.download_txt_item_acronym) TextView acronym;
@InjectView(R.id.txt_download_item_name) TextView itemName;
@InjectView(R.id.download_ibtn_download) ImageButton isDownloaded;
@InjectView(R.id.download_prg_download) ProgressWheel downloadProgress;
public BookItemView (Context ctx) {
super(ctx);
@ -80,5 +79,12 @@ public class BookListAdapter extends BaseAdapter {
acronym.setText(b.getInitials());
itemName.setText(b.getName());
}
@OnClick(R.id.download_ibtn_download)
public void onDownloadItem(View v) {
isDownloaded.setVisibility(View.GONE);
downloadProgress.setVisibility(View.VISIBLE);
downloadProgress.setProgress(75); // Out of 360
}
}
}

View File

@ -12,6 +12,8 @@ import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.Toast;
import com.f2prateek.dart.InjectExtra;
import org.bspeice.minimalbible.MinimalBible;
import org.bspeice.minimalbible.R;
import org.bspeice.minimalbible.activities.BaseFragment;
@ -38,6 +40,7 @@ import butterknife.InjectView;
public class BookListFragment extends BaseFragment {
/**
* The fragment argument representing the section number for this fragment.
* Not a candidate for Dart (yet) because I would have to write a Parcelable around it.
*/
private static final String ARG_BOOK_CATEGORY = "book_category";