mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Merge remote-tracking branch 'refs/remotes/origin/2.7.x-release'
This commit is contained in:
commit
5c479b5624
3 changed files with 16 additions and 2 deletions
|
|
@ -144,7 +144,6 @@ public class ContributionsActivity
|
||||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("beta")){
|
if(!BuildConfig.FLAVOR.equalsIgnoreCase("beta")){
|
||||||
setUploadCount();
|
setUploadCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
|
@ -47,6 +48,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
||||||
TextView waitingMessage;
|
TextView waitingMessage;
|
||||||
@BindView(R.id.loadingContributionsProgressBar)
|
@BindView(R.id.loadingContributionsProgressBar)
|
||||||
ProgressBar progressBar;
|
ProgressBar progressBar;
|
||||||
|
@BindView(R.id.swipeRefreshLayout)
|
||||||
|
SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Named("prefs")
|
@Named("prefs")
|
||||||
|
|
@ -64,6 +67,13 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
||||||
ButterKnife.bind(this, v);
|
ButterKnife.bind(this, v);
|
||||||
|
|
||||||
contributionsList.setOnItemClickListener((AdapterView.OnItemClickListener) getActivity());
|
contributionsList.setOnItemClickListener((AdapterView.OnItemClickListener) getActivity());
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
((ContributionsListAdapter)contributionsList.getAdapter()).notifyDataSetChanged();
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
Timber.d("Scrolling to %d", savedInstanceState.getInt("grid-position"));
|
Timber.d("Scrolling to %d", savedInstanceState.getInt("grid-position"));
|
||||||
contributionsList.setSelection(savedInstanceState.getInt("grid-position"));
|
contributionsList.setSelection(savedInstanceState.getInt("grid-position"));
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@
|
||||||
android:id="@+id/loadingContributionsProgressBar"
|
android:id="@+id/loadingContributionsProgressBar"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/swipeRefreshLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
android:id="@+id/contributionsList"
|
android:id="@+id/contributionsList"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -35,5 +40,5 @@
|
||||||
android:fadingEdge="none"
|
android:fadingEdge="none"
|
||||||
android:fastScrollEnabled="true"
|
android:fastScrollEnabled="true"
|
||||||
/>
|
/>
|
||||||
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue