mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Add progressbar
This commit is contained in:
parent
77639ce64f
commit
8b5a4e4af4
4 changed files with 29 additions and 8 deletions
|
|
@ -16,6 +16,7 @@ import android.view.Menu;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.viewpagerindicator.CirclePageIndicator;
|
||||
|
||||
|
|
@ -82,7 +83,6 @@ public class ReviewActivity extends AuthenticatedActivity {
|
|||
|
||||
reviewController = new ReviewController();
|
||||
|
||||
|
||||
reviewPagerAdapter = new ReviewPagerAdapter(getSupportFragmentManager());
|
||||
pager.setAdapter(reviewPagerAdapter);
|
||||
reviewPagerAdapter.getItem(0);
|
||||
|
|
@ -109,6 +109,10 @@ public class ReviewActivity extends AuthenticatedActivity {
|
|||
}
|
||||
|
||||
private boolean runRandomizer() {
|
||||
ProgressBar progressBar = reviewPagerAdapter.reviewImageFragments[pager.getCurrentItem()].progressBar;
|
||||
if (progressBar != null) {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
Observable.fromCallable(() -> {
|
||||
Media result = null;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
private String catString;
|
||||
private View catsView;
|
||||
private SimpleDraweeView simpleDraweeView;
|
||||
public ProgressBar progressBar;
|
||||
|
||||
public void update(int position, String fileName) {
|
||||
this.position = position;
|
||||
|
|
@ -41,6 +43,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
if (simpleDraweeView!=null) {
|
||||
simpleDraweeView.setImageURI(Utils.makeThumbBaseUrl(fileName));
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +66,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
position = getArguments().getInt("position");
|
||||
View layoutView = inflater.inflate(R.layout.fragment_review_image, container,
|
||||
false);
|
||||
progressBar = layoutView.findViewById(R.id.progressBar);
|
||||
View textView = layoutView.findViewById(R.id.reviewQuestion);
|
||||
View textViewQuestion = layoutView.findViewById(R.id.reviewQuestion);
|
||||
View textViewQuestionContext = layoutView.findViewById(R.id.reviewQuestionContext);
|
||||
|
|
@ -89,6 +93,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
if (fileName != null) {
|
||||
simpleDraweeView.setImageURI(Utils.makeThumbBaseUrl(fileName));
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
if (catString != null) {
|
||||
((TextView) catsView).setText(catString);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@
|
|||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
|
|
|||
|
|
@ -8,13 +8,27 @@
|
|||
android:gravity="center_horizontal|bottom"
|
||||
>
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/imageView"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"
|
||||
android:src="@drawable/commons_logo_large"
|
||||
/>
|
||||
android:layout_weight="3">
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/commons_logo_large"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="visible"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reviewQuestion"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue