mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Inifilate contributions list fragment view
This commit is contained in:
parent
7d8a44b75f
commit
d59a258b91
4 changed files with 121 additions and 36 deletions
|
|
@ -8,18 +8,24 @@ import android.content.Loader;
|
|||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.DataSetObserver;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import fr.free.nrw.commons.BuildConfig;
|
||||
import fr.free.nrw.commons.Media;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
|
||||
|
|
@ -49,10 +55,25 @@ public class ContributionsFragment
|
|||
@Inject
|
||||
NotificationController notificationController;
|
||||
|
||||
public TextView numberOfUploads;
|
||||
public ProgressBar numberOfUploadsProgressBar;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
View view = inflater.inflate(R.layout.fragment_contributions, container, false);
|
||||
numberOfUploads = view.findViewById(R.id.numOfUploads);
|
||||
|
||||
numberOfUploadsProgressBar = view.findViewById(R.id.progressBar);
|
||||
numberOfUploadsProgressBar.setVisibility(View.VISIBLE);
|
||||
numberOfUploadsProgressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(getActivity(), R.color.white), PorterDuff.Mode.SRC_IN );
|
||||
|
||||
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("beta")){
|
||||
setUploadCount();
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.fragment_contributions, container, false);
|
||||
View v = inflater.inflate(R.layout.fragment_contributions_list, container, false);
|
||||
ButterKnife.bind(this, v);
|
||||
|
||||
contributionsList.setOnItemClickListener((AdapterView.OnItemClickListener) getActivity());
|
||||
|
|
|
|||
|
|
@ -1,39 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/mainBackground"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/waiting_first_sync"
|
||||
android:id="@+id/waitingMessage"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_centerHorizontal="true"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:id="@+id/loadingContributionsProgressBar"
|
||||
/>
|
||||
|
||||
<GridView
|
||||
android:id="@+id/contributionsList"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<!--
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:stretchMode="columnWidth"
|
||||
android:columnWidth="240dp"
|
||||
android:numColumns="auto_fit"
|
||||
android:listSelector="@null"
|
||||
android:fadingEdge="none"
|
||||
android:fastScrollEnabled="true"
|
||||
/>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</RelativeLayout>
|
||||
<fr.free.nrw.commons.contributions.CustomNotificationsCardView
|
||||
android:id="@+id/card_view_notifications"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
app:cardBackgroundColor="?attr/mainCardBackround"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:id="@+id/customNotificationsProgressBar"
|
||||
|
||||
/>
|
||||
|
||||
</fr.free.nrw.commons.contributions.CustomNotificationsCardView>
|
||||
</RelativeLayout>
|
||||
-->
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_margin="15dp"
|
||||
android:id="@+id/progressBar"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/numOfUploads"
|
||||
android:visibility="gone"
|
||||
android:layout_margin="15dp"
|
||||
style="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle"
|
||||
android:textColor="@android:color/white"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="#000"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/root_frame">
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
39
app/src/main/res/layout/fragment_contributions_list.xml
Normal file
39
app/src/main/res/layout/fragment_contributions_list.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/mainBackground"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/waiting_first_sync"
|
||||
android:id="@+id/waitingMessage"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_centerHorizontal="true"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:id="@+id/loadingContributionsProgressBar"
|
||||
/>
|
||||
|
||||
<GridView
|
||||
android:id="@+id/contributionsList"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:stretchMode="columnWidth"
|
||||
android:columnWidth="240dp"
|
||||
android:numColumns="auto_fit"
|
||||
android:listSelector="@null"
|
||||
android:fadingEdge="none"
|
||||
android:fastScrollEnabled="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue