mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Merge branch 'master' into directNearbyUploadsNew
This commit is contained in:
		
						commit
						50d9cff8c6
					
				
					 152 changed files with 2687 additions and 945 deletions
				
			
		|  | @ -8,6 +8,7 @@ import android.net.Uri; | |||
| import android.os.RemoteException; | ||||
| import android.support.annotation.Nullable; | ||||
| import android.text.TextUtils; | ||||
| import android.util.Log; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
|  | @ -115,23 +116,30 @@ public class ContributionDao { | |||
|         // Hardcoding column positions! | ||||
|         //Check that cursor has a value to avoid CursorIndexOutOfBoundsException | ||||
|         if (cursor.getCount() > 0) { | ||||
|             int index; | ||||
|             if (cursor.getColumnIndex(Table.COLUMN_LICENSE) == -1){ | ||||
|                 index = 15; | ||||
|             } else { | ||||
|                 index = cursor.getColumnIndex(Table.COLUMN_LICENSE); | ||||
|             } | ||||
|             return new Contribution( | ||||
|                     uriForId(cursor.getInt(0)), | ||||
|                     cursor.getString(1), | ||||
|                     parseUri(cursor.getString(2)), | ||||
|                     cursor.getString(3), | ||||
|                     parseTimestamp(cursor.getLong(4)), | ||||
|                     cursor.getInt(5), | ||||
|                     cursor.getLong(6), | ||||
|                     parseTimestamp(cursor.getLong(7)), | ||||
|                     cursor.getLong(8), | ||||
|                     cursor.getString(9), | ||||
|                     cursor.getString(10), | ||||
|                     cursor.getString(11), | ||||
|                     cursor.getInt(12) == 1, | ||||
|                     cursor.getInt(13), | ||||
|                     cursor.getInt(14), | ||||
|                     cursor.getString(15)); | ||||
|                     uriForId(cursor.getInt(cursor.getColumnIndex(Table.COLUMN_ID))), | ||||
|                     cursor.getString(cursor.getColumnIndex(Table.COLUMN_FILENAME)), | ||||
|                     parseUri(cursor.getString(cursor.getColumnIndex(Table.COLUMN_LOCAL_URI))), | ||||
|                     cursor.getString(cursor.getColumnIndex(Table.COLUMN_IMAGE_URL)), | ||||
|                     parseTimestamp(cursor.getLong(cursor.getColumnIndex(Table.COLUMN_TIMESTAMP))), | ||||
|                     cursor.getInt(cursor.getColumnIndex(Table.COLUMN_STATE)), | ||||
|                     cursor.getLong(cursor.getColumnIndex(Table.COLUMN_LENGTH)), | ||||
|                     parseTimestamp(cursor.getLong(cursor.getColumnIndex(Table.COLUMN_UPLOADED))), | ||||
|                     cursor.getLong(cursor.getColumnIndex(Table.COLUMN_TRANSFERRED)), | ||||
|                     cursor.getString(cursor.getColumnIndex(Table.COLUMN_SOURCE)), | ||||
|                     cursor.getString(cursor.getColumnIndex(Table.COLUMN_DESCRIPTION)), | ||||
|                     cursor.getString(cursor.getColumnIndex(Table.COLUMN_CREATOR)), | ||||
|                     cursor.getInt(cursor.getColumnIndex(Table.COLUMN_MULTIPLE)) == 1, | ||||
|                     cursor.getInt(cursor.getColumnIndex(Table.COLUMN_WIDTH)), | ||||
|                     cursor.getInt(cursor.getColumnIndex(Table.COLUMN_HEIGHT)), | ||||
|                     cursor.getString(index) | ||||
|             ); | ||||
|         } | ||||
| 
 | ||||
|         return null; | ||||
|  |  | |||
|  | @ -26,6 +26,7 @@ import javax.inject.Inject; | |||
| import javax.inject.Named; | ||||
| 
 | ||||
| import butterknife.ButterKnife; | ||||
| import fr.free.nrw.commons.BuildConfig; | ||||
| import fr.free.nrw.commons.HandlerService; | ||||
| import fr.free.nrw.commons.Media; | ||||
| import fr.free.nrw.commons.R; | ||||
|  | @ -139,7 +140,11 @@ public  class       ContributionsActivity | |||
|         requestAuthToken(); | ||||
|         initDrawer(); | ||||
|         setTitle(getString(R.string.title_activity_contributions)); | ||||
|         setUploadCount(); | ||||
| 
 | ||||
|         if(!BuildConfig.FLAVOR.equalsIgnoreCase("beta")){ | ||||
|             setUploadCount(); | ||||
|         } | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  | @ -279,6 +284,12 @@ public  class       ContributionsActivity | |||
|                 )); | ||||
|     } | ||||
| 
 | ||||
|     public void betaSetUploadCount(int betaUploadCount){ | ||||
|         getSupportActionBar().setSubtitle(getResources() | ||||
|                 .getQuantityString(R.plurals.contributions_subtitle, betaUploadCount, betaUploadCount)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void notifyDatasetChanged() { | ||||
|         // Do nothing for now | ||||
|  |  | |||
|  | @ -27,6 +27,7 @@ import javax.inject.Named; | |||
| 
 | ||||
| import butterknife.BindView; | ||||
| import butterknife.ButterKnife; | ||||
| import fr.free.nrw.commons.BuildConfig; | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.di.CommonsDaggerSupportFragment; | ||||
| import fr.free.nrw.commons.nearby.NearbyActivity; | ||||
|  | @ -56,6 +57,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { | |||
| 
 | ||||
|     private ContributionController controller; | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||||
|         View v = inflater.inflate(R.layout.fragment_contributions, container, false); | ||||
|  | @ -87,6 +89,10 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { | |||
| 
 | ||||
|     public void setAdapter(ListAdapter adapter) { | ||||
|         this.contributionsList.setAdapter(adapter); | ||||
| 
 | ||||
|         if(BuildConfig.FLAVOR.equalsIgnoreCase("beta")){ | ||||
|             ((ContributionsActivity) getActivity()).betaSetUploadCount(adapter.getCount()); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public void changeProgressBarVisibility(boolean isVisible) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vivek Maskara
						Vivek Maskara