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/commons-app/master'
This commit is contained in:
commit
3274c4cc4a
20 changed files with 185 additions and 93 deletions
|
|
@ -0,0 +1,57 @@
|
||||||
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.test.InstrumentationRegistry;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.location.LatLng;
|
||||||
|
import fr.free.nrw.commons.nearby.NearbyBaseMarker;
|
||||||
|
import fr.free.nrw.commons.nearby.NearbyController;
|
||||||
|
import fr.free.nrw.commons.nearby.Place;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class NearbyControllerTest {
|
||||||
|
private Context instrumentationContext;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
instrumentationContext = InstrumentationRegistry.getContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test public void testNullAttractions() {
|
||||||
|
LatLng location = new LatLng(0, 0);
|
||||||
|
|
||||||
|
List<NearbyBaseMarker> options =
|
||||||
|
NearbyController.loadAttractionsFromLocationToBaseMarkerOptions(
|
||||||
|
location,
|
||||||
|
null,
|
||||||
|
instrumentationContext
|
||||||
|
);
|
||||||
|
|
||||||
|
Assert.assertThat(options.size(), is(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test public void testEmptyList() {
|
||||||
|
LatLng location = new LatLng(0, 0);
|
||||||
|
List<Place> emptyList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<NearbyBaseMarker> options =
|
||||||
|
NearbyController.loadAttractionsFromLocationToBaseMarkerOptions(
|
||||||
|
location,
|
||||||
|
emptyList,
|
||||||
|
instrumentationContext
|
||||||
|
);
|
||||||
|
|
||||||
|
Assert.assertThat(options.size(), is(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,11 @@ package fr.free.nrw.commons;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.graphics.drawable.VectorDrawableCompat;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
|
||||||
public class MediaWikiImageView extends SimpleDraweeView {
|
public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
|
|
@ -13,14 +15,17 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
|
|
||||||
public MediaWikiImageView(Context context) {
|
public MediaWikiImageView(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MediaWikiImageView(Context context, AttributeSet attrs) {
|
public MediaWikiImageView(Context context, AttributeSet attrs) {
|
||||||
this(context, attrs, 0);
|
this(context, attrs, 0);
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MediaWikiImageView(Context context, AttributeSet attrs, int defStyle) {
|
public MediaWikiImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMedia(Media media) {
|
public void setMedia(Media media) {
|
||||||
|
|
@ -48,6 +53,16 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
setHierarchy(GenericDraweeHierarchyBuilder
|
||||||
|
.newInstance(getResources())
|
||||||
|
.setPlaceholderImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_image_black_24dp, getContext().getTheme()))
|
||||||
|
.setFailureImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_image_black_24dp, getContext().getTheme()))
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
private void setImageUrl(@Nullable String url) {
|
private void setImageUrl(@Nullable String url) {
|
||||||
setImageURI(url);
|
setImageURI(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ public class WelcomeActivity extends BaseActivity {
|
||||||
|
|
||||||
@BindView(R.id.welcomePager) ViewPager pager;
|
@BindView(R.id.welcomePager) ViewPager pager;
|
||||||
@BindView(R.id.welcomePagerIndicator) CirclePageIndicator indicator;
|
@BindView(R.id.welcomePagerIndicator) CirclePageIndicator indicator;
|
||||||
|
private WelcomePagerAdapter adapter = new WelcomePagerAdapter();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -24,12 +25,19 @@ public class WelcomeActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
setUpAdapter();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpAdapter() {
|
|
||||||
WelcomePagerAdapter adapter = new WelcomePagerAdapter(this);
|
|
||||||
pager.setAdapter(adapter);
|
pager.setAdapter(adapter);
|
||||||
indicator.setViewPager(pager);
|
indicator.setViewPager(pager);
|
||||||
|
adapter.setCallback(new WelcomePagerAdapter.Callback() {
|
||||||
|
@Override
|
||||||
|
public void onYesClicked() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
adapter.setCallback(null);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package fr.free.nrw.commons;
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.support.annotation.Nullable;
|
||||||
import android.content.Context;
|
|
||||||
import android.support.v4.view.PagerAdapter;
|
import android.support.v4.view.PagerAdapter;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -11,10 +10,12 @@ import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
|
||||||
public class WelcomePagerAdapter extends PagerAdapter {
|
public class WelcomePagerAdapter extends PagerAdapter {
|
||||||
|
|
||||||
private Context context;
|
|
||||||
|
|
||||||
private static final int PAGE_FINAL = 4;
|
private static final int PAGE_FINAL = 4;
|
||||||
|
private Callback callback;
|
||||||
|
|
||||||
|
public interface Callback {
|
||||||
|
void onYesClicked();
|
||||||
|
}
|
||||||
|
|
||||||
static final int[] PAGE_LAYOUTS = new int[]{
|
static final int[] PAGE_LAYOUTS = new int[]{
|
||||||
R.layout.welcome_wikipedia,
|
R.layout.welcome_wikipedia,
|
||||||
|
|
@ -24,8 +25,8 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
||||||
R.layout.welcome_final
|
R.layout.welcome_final
|
||||||
};
|
};
|
||||||
|
|
||||||
public WelcomePagerAdapter(Context context) {
|
public void setCallback(@Nullable Callback callback) {
|
||||||
this.context = context;
|
this.callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -40,11 +41,11 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object instantiateItem(ViewGroup container, int position) {
|
public Object instantiateItem(ViewGroup container, int position) {
|
||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
LayoutInflater inflater = LayoutInflater.from(container.getContext());
|
||||||
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
|
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
|
||||||
|
|
||||||
if (position == PAGE_FINAL) {
|
if (position == PAGE_FINAL) {
|
||||||
ViewHolder holder = new ViewHolder(layout, context);
|
ViewHolder holder = new ViewHolder(layout);
|
||||||
layout.setTag(holder);
|
layout.setTag(holder);
|
||||||
}
|
}
|
||||||
container.addView(layout);
|
container.addView(layout);
|
||||||
|
|
@ -56,17 +57,16 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
||||||
container.removeView((View) obj);
|
container.removeView((View) obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ViewHolder {
|
class ViewHolder {
|
||||||
private Context context;
|
ViewHolder(View view) {
|
||||||
|
|
||||||
public ViewHolder(View view, Context context) {
|
|
||||||
ButterKnife.bind(this, view);
|
ButterKnife.bind(this, view);
|
||||||
this.context = context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.welcomeYesButton)
|
@OnClick(R.id.welcomeYesButton)
|
||||||
void onClicked() {
|
void onClicked() {
|
||||||
((Activity) context).finish();
|
if (callback != null) {
|
||||||
|
callback.onYesClicked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
app = CommonsApplication.getInstance();
|
app = CommonsApplication.getInstance();
|
||||||
|
|
||||||
setContentView(R.layout.activity_login);
|
setContentView(R.layout.activity_login);
|
||||||
final LoginActivity that = this;
|
|
||||||
|
|
||||||
loginButton = (Button) findViewById(R.id.loginButton);
|
loginButton = (Button) findViewById(R.id.loginButton);
|
||||||
Button signupButton = (Button) findViewById(R.id.signupButton);
|
Button signupButton = (Button) findViewById(R.id.signupButton);
|
||||||
|
|
@ -62,12 +61,14 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
loginButton.setOnClickListener(new View.OnClickListener() {
|
loginButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
that.performLogin();
|
performLogin();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
signupButton.setOnClickListener(new View.OnClickListener() {
|
signupButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) { that.signUp(v); }
|
public void onClick(View v) {
|
||||||
|
signUp(v);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,7 +116,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (prefs.getBoolean("firstrun", true)) {
|
if (prefs.getBoolean("firstrun", true)) {
|
||||||
this.startWelcomeIntent();
|
startWelcomeIntent();
|
||||||
prefs.edit().putBoolean("firstrun", false).apply();
|
prefs.edit().putBoolean("firstrun", false).apply();
|
||||||
}
|
}
|
||||||
if (app.getCurrentAccount() != null) {
|
if (app.getCurrentAccount() != null) {
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ public class ContributionsActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
getSupportFragmentManager().removeOnBackStackChangedListener(this);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if(isUploadServiceConnected) {
|
if(isUploadServiceConnected) {
|
||||||
unbindService(uploadServiceConnection);
|
unbindService(uploadServiceConnection);
|
||||||
|
|
@ -227,7 +228,8 @@ public class ContributionsActivity
|
||||||
@Override
|
@Override
|
||||||
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
||||||
if(contributionsList.getAdapter() == null) {
|
if(contributionsList.getAdapter() == null) {
|
||||||
contributionsList.setAdapter(new ContributionsListAdapter(this, cursor, 0));
|
contributionsList
|
||||||
|
.setAdapter(new ContributionsListAdapter(getApplicationContext(), cursor, 0));
|
||||||
} else {
|
} else {
|
||||||
((CursorAdapter)contributionsList.getAdapter()).swapCursor(cursor);
|
((CursorAdapter)contributionsList.getAdapter()).swapCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,24 @@
|
||||||
package fr.free.nrw.commons.contributions;
|
package fr.free.nrw.commons.contributions;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
|
|
||||||
class ContributionsListAdapter extends CursorAdapter {
|
class ContributionsListAdapter extends CursorAdapter {
|
||||||
private Activity activity;
|
|
||||||
|
|
||||||
public ContributionsListAdapter(Activity activity, Cursor c, int flags) {
|
public ContributionsListAdapter(Context context, Cursor c, int flags) {
|
||||||
super(activity, c, flags);
|
super(context, c, flags);
|
||||||
this.activity = activity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
|
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
|
||||||
View parent = activity.getLayoutInflater().inflate(R.layout.layout_contribution, viewGroup, false);
|
View parent = LayoutInflater.from(context)
|
||||||
|
.inflate(R.layout.layout_contribution, viewGroup, false);
|
||||||
parent.setTag(new ContributionViewHolder(parent));
|
parent.setTag(new ContributionViewHolder(parent));
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,6 @@ public class CategoryModifier extends PageModifier {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEditSumary() {
|
public String getEditSumary() {
|
||||||
return String.format("Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories.");
|
return "Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,20 @@ public class NearbyController {
|
||||||
*Loads attractions from location for map view, we need to return BaseMarkerOption data type.
|
*Loads attractions from location for map view, we need to return BaseMarkerOption data type.
|
||||||
* @param curLatLng users current location
|
* @param curLatLng users current location
|
||||||
* @param placeList list of nearby places in Place data type
|
* @param placeList list of nearby places in Place data type
|
||||||
* @return BaseMarkerOprions list that holds nearby places
|
* @return BaseMarkerOptions list that holds nearby places
|
||||||
*/
|
*/
|
||||||
public static List<NearbyBaseMarker> loadAttractionsFromLocationToBaseMarkerOptions(
|
public static List<NearbyBaseMarker> loadAttractionsFromLocationToBaseMarkerOptions(
|
||||||
LatLng curLatLng,
|
LatLng curLatLng,
|
||||||
List<Place> placeList,
|
List<Place> placeList,
|
||||||
Context context) {
|
Context context) {
|
||||||
List<NearbyBaseMarker> baseMarkerOptionses = new ArrayList<>();
|
List<NearbyBaseMarker> baseMarkerOptions = new ArrayList<>();
|
||||||
|
|
||||||
|
if (placeList == null) {
|
||||||
|
return baseMarkerOptions;
|
||||||
|
}
|
||||||
|
|
||||||
placeList = placeList.subList(0, Math.min(placeList.size(), MAX_RESULTS));
|
placeList = placeList.subList(0, Math.min(placeList.size(), MAX_RESULTS));
|
||||||
|
|
||||||
for (Place place: placeList) {
|
for (Place place: placeList) {
|
||||||
String distance = formatDistanceBetween(curLatLng, place.location);
|
String distance = formatDistanceBetween(curLatLng, place.location);
|
||||||
place.setDistance(distance);
|
place.setDistance(distance);
|
||||||
|
|
@ -108,8 +114,8 @@ public class NearbyController {
|
||||||
nearbyBaseMarker.place(place);
|
nearbyBaseMarker.place(place);
|
||||||
nearbyBaseMarker.icon(icon);
|
nearbyBaseMarker.icon(icon);
|
||||||
|
|
||||||
baseMarkerOptionses.add(nearbyBaseMarker);
|
baseMarkerOptions.add(nearbyBaseMarker);
|
||||||
}
|
}
|
||||||
return baseMarkerOptionses;
|
return baseMarkerOptions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class FileUtils {
|
||||||
*/
|
*/
|
||||||
// Can be safely suppressed, checks for isKitKat before running isDocumentUri
|
// Can be safely suppressed, checks for isKitKat before running isDocumentUri
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public static String getPath(final Context context, final Uri uri) {
|
public static String getPath(Context context, Uri uri) {
|
||||||
|
|
||||||
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import android.support.annotation.Nullable;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.CommonsApplication;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -26,15 +27,13 @@ public class GPSExtractor {
|
||||||
private double decLatitude, decLongitude;
|
private double decLatitude, decLongitude;
|
||||||
private Double currentLatitude = null;
|
private Double currentLatitude = null;
|
||||||
private Double currentLongitude = null;
|
private Double currentLongitude = null;
|
||||||
private Context context;
|
|
||||||
public boolean imageCoordsExists;
|
public boolean imageCoordsExists;
|
||||||
private MyLocationListener myLocationListener;
|
private MyLocationListener myLocationListener;
|
||||||
private LocationManager locationManager;
|
private LocationManager locationManager;
|
||||||
|
|
||||||
|
|
||||||
public GPSExtractor(String filePath, Context context){
|
public GPSExtractor(String filePath) {
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
this.context = context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,7 +41,8 @@ public class GPSExtractor {
|
||||||
* @return true if enabled, false if disabled
|
* @return true if enabled, false if disabled
|
||||||
*/
|
*/
|
||||||
private boolean gpsPreferenceEnabled() {
|
private boolean gpsPreferenceEnabled() {
|
||||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences sharedPref
|
||||||
|
= PreferenceManager.getDefaultSharedPreferences(CommonsApplication.getInstance());
|
||||||
boolean gpsPref = sharedPref.getBoolean("allowGps", false);
|
boolean gpsPref = sharedPref.getBoolean("allowGps", false);
|
||||||
Timber.d("Gps pref set to: %b", gpsPref);
|
Timber.d("Gps pref set to: %b", gpsPref);
|
||||||
return gpsPref;
|
return gpsPref;
|
||||||
|
|
@ -52,7 +52,8 @@ public class GPSExtractor {
|
||||||
* Registers a LocationManager to listen for current location
|
* Registers a LocationManager to listen for current location
|
||||||
*/
|
*/
|
||||||
protected void registerLocationManager() {
|
protected void registerLocationManager() {
|
||||||
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
locationManager = (LocationManager) CommonsApplication.getInstance()
|
||||||
|
.getSystemService(Context.LOCATION_SERVICE);
|
||||||
Criteria criteria = new Criteria();
|
Criteria criteria = new Criteria();
|
||||||
String provider = locationManager.getBestProvider(criteria, true);
|
String provider = locationManager.getBestProvider(criteria, true);
|
||||||
myLocationListener = new MyLocationListener();
|
myLocationListener = new MyLocationListener();
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public class MultipleShareActivity
|
||||||
|
|
||||||
Timber.d("Multiple upload begins");
|
Timber.d("Multiple upload begins");
|
||||||
|
|
||||||
final ProgressDialog dialog = new ProgressDialog(MultipleShareActivity.this);
|
final ProgressDialog dialog = new ProgressDialog(this);
|
||||||
dialog.setIndeterminate(false);
|
dialog.setIndeterminate(false);
|
||||||
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
dialog.setMax(photosList.size());
|
dialog.setMax(photosList.size());
|
||||||
|
|
@ -145,12 +145,12 @@ public class MultipleShareActivity
|
||||||
|
|
||||||
uploadsList.setImageOnlyMode(true);
|
uploadsList.setImageOnlyMode(true);
|
||||||
|
|
||||||
categorizationFragment = (CategorizationFragment) this.getSupportFragmentManager().findFragmentByTag("categorization");
|
categorizationFragment = (CategorizationFragment) getSupportFragmentManager().findFragmentByTag("categorization");
|
||||||
if(categorizationFragment == null) {
|
if(categorizationFragment == null) {
|
||||||
categorizationFragment = new CategorizationFragment();
|
categorizationFragment = new CategorizationFragment();
|
||||||
}
|
}
|
||||||
// FIXME: Stops the keyboard from being shown 'stale' while moving out of this fragment into the next
|
// FIXME: Stops the keyboard from being shown 'stale' while moving out of this fragment into the next
|
||||||
View target = this.getCurrentFocus();
|
View target = getCurrentFocus();
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
InputMethodManager imm = (InputMethodManager) target.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) target.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.hideSoftInputFromWindow(target.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(target.getWindowToken(), 0);
|
||||||
|
|
@ -203,7 +203,7 @@ public class MultipleShareActivity
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
uploadController = new UploadController(this);
|
uploadController = new UploadController();
|
||||||
|
|
||||||
setContentView(R.layout.activity_multiple_uploads);
|
setContentView(R.layout.activity_multiple_uploads);
|
||||||
app = CommonsApplication.getInstance();
|
app = CommonsApplication.getInstance();
|
||||||
|
|
@ -221,18 +221,19 @@ public class MultipleShareActivity
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
getSupportFragmentManager().removeOnBackStackChangedListener(this);
|
||||||
uploadController.cleanup();
|
uploadController.cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDetail(int i) {
|
private void showDetail(int i) {
|
||||||
if(mediaDetails == null ||!mediaDetails.isVisible()) {
|
if(mediaDetails == null ||!mediaDetails.isVisible()) {
|
||||||
mediaDetails = new MediaDetailPagerFragment(true);
|
mediaDetails = new MediaDetailPagerFragment(true);
|
||||||
this.getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.uploadsFragmentContainer, mediaDetails)
|
.replace(R.id.uploadsFragmentContainer, mediaDetails)
|
||||||
.addToBackStack(null)
|
.addToBackStack(null)
|
||||||
.commit();
|
.commit();
|
||||||
this.getSupportFragmentManager().executePendingTransactions();
|
getSupportFragmentManager().executePendingTransactions();
|
||||||
}
|
}
|
||||||
mediaDetails.showImage(i);
|
mediaDetails.showImage(i);
|
||||||
}
|
}
|
||||||
|
|
@ -267,7 +268,7 @@ public class MultipleShareActivity
|
||||||
uploadsList = (MultipleUploadListFragment) getSupportFragmentManager().findFragmentByTag("uploadsList");
|
uploadsList = (MultipleUploadListFragment) getSupportFragmentManager().findFragmentByTag("uploadsList");
|
||||||
if(uploadsList == null) {
|
if(uploadsList == null) {
|
||||||
uploadsList = new MultipleUploadListFragment();
|
uploadsList = new MultipleUploadListFragment();
|
||||||
this.getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.add(R.id.uploadsFragmentContainer, uploadsList, "uploadsList")
|
.add(R.id.uploadsFragmentContainer, uploadsList, "uploadsList")
|
||||||
.commit();
|
.commit();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import android.content.Context;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.graphics.drawable.VectorDrawableCompat;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
|
|
@ -24,6 +26,7 @@ import android.widget.GridView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
|
|
@ -82,7 +85,13 @@ public class MultipleUploadListFragment extends Fragment {
|
||||||
holder.overlay = (RelativeLayout) view.findViewById(R.id.uploadOverlay);
|
holder.overlay = (RelativeLayout) view.findViewById(R.id.uploadOverlay);
|
||||||
|
|
||||||
holder.image.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, photoSize.y));
|
holder.image.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, photoSize.y));
|
||||||
|
holder.image.setHierarchy(GenericDraweeHierarchyBuilder
|
||||||
|
.newInstance(getResources())
|
||||||
|
.setPlaceholderImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_image_black_24dp, getContext().getTheme()))
|
||||||
|
.setFailureImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_error_outline_black_24dp, getContext().getTheme()))
|
||||||
|
.build());
|
||||||
view.setTag(holder);
|
view.setTag(holder);
|
||||||
} else {
|
} else {
|
||||||
holder = (UploadHolderView)view.getTag();
|
holder = (UploadHolderView)view.getTag();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package fr.free.nrw.commons.upload;
|
package fr.free.nrw.commons.upload;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
import com.android.volley.Cache;
|
import com.android.volley.Cache;
|
||||||
|
|
@ -21,6 +20,7 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.CommonsApplication;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -32,15 +32,13 @@ public class MwVolleyApi {
|
||||||
|
|
||||||
private static RequestQueue REQUEST_QUEUE;
|
private static RequestQueue REQUEST_QUEUE;
|
||||||
private static final Gson GSON = new GsonBuilder().create();
|
private static final Gson GSON = new GsonBuilder().create();
|
||||||
private Context context;
|
|
||||||
|
|
||||||
protected static Set<String> categorySet;
|
protected static Set<String> categorySet;
|
||||||
private static List<String> categoryList;
|
private static List<String> categoryList;
|
||||||
|
|
||||||
private static final String MWURL = "https://commons.wikimedia.org/";
|
private static final String MWURL = "https://commons.wikimedia.org/";
|
||||||
|
|
||||||
public MwVolleyApi(Context context) {
|
public MwVolleyApi() {
|
||||||
this.context = context;
|
|
||||||
categorySet = new HashSet<>();
|
categorySet = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94,12 +92,8 @@ public class MwVolleyApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized RequestQueue getQueue() {
|
private synchronized RequestQueue getQueue() {
|
||||||
return getQueue(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static RequestQueue getQueue(Context context) {
|
|
||||||
if (REQUEST_QUEUE == null) {
|
if (REQUEST_QUEUE == null) {
|
||||||
REQUEST_QUEUE = Volley.newRequestQueue(context);
|
REQUEST_QUEUE = Volley.newRequestQueue(CommonsApplication.getInstance());
|
||||||
}
|
}
|
||||||
return REQUEST_QUEUE;
|
return REQUEST_QUEUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.graphics.drawable.VectorDrawableCompat;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
@ -16,6 +17,7 @@ import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -60,7 +62,6 @@ public class ShareActivity
|
||||||
|
|
||||||
private UploadController uploadController;
|
private UploadController uploadController;
|
||||||
|
|
||||||
private CommonsApplication cacheObj;
|
|
||||||
private boolean cacheFound;
|
private boolean cacheFound;
|
||||||
|
|
||||||
private GPSExtractor imageObj;
|
private GPSExtractor imageObj;
|
||||||
|
|
@ -196,7 +197,7 @@ public class ShareActivity
|
||||||
categorizationFragment = (CategorizationFragment) getSupportFragmentManager().findFragmentByTag("categorization");
|
categorizationFragment = (CategorizationFragment) getSupportFragmentManager().findFragmentByTag("categorization");
|
||||||
if(shareView == null && categorizationFragment == null) {
|
if(shareView == null && categorizationFragment == null) {
|
||||||
shareView = new SingleUploadFragment();
|
shareView = new SingleUploadFragment();
|
||||||
this.getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.add(R.id.single_upload_fragment_container, shareView, "shareView")
|
.add(R.id.single_upload_fragment_container, shareView, "shareView")
|
||||||
.commitAllowingStateLoss();
|
.commitAllowingStateLoss();
|
||||||
|
|
@ -214,12 +215,19 @@ public class ShareActivity
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
uploadController = new UploadController(this);
|
uploadController = new UploadController();
|
||||||
setContentView(R.layout.activity_share);
|
setContentView(R.layout.activity_share);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
initBack();
|
initBack();
|
||||||
app = CommonsApplication.getInstance();
|
app = CommonsApplication.getInstance();
|
||||||
backgroundImageView = (SimpleDraweeView)findViewById(R.id.backgroundImage);
|
backgroundImageView = (SimpleDraweeView)findViewById(R.id.backgroundImage);
|
||||||
|
backgroundImageView.setHierarchy(GenericDraweeHierarchyBuilder
|
||||||
|
.newInstance(getResources())
|
||||||
|
.setPlaceholderImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_image_black_24dp, getTheme()))
|
||||||
|
.setFailureImage(VectorDrawableCompat.create(getResources(),
|
||||||
|
R.drawable.ic_error_outline_black_24dp, getTheme()))
|
||||||
|
.build());
|
||||||
|
|
||||||
//Receive intent from ContributionController.java when user selects picture to upload
|
//Receive intent from ContributionController.java when user selects picture to upload
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
|
@ -373,11 +381,11 @@ public class ShareActivity
|
||||||
* @param gpsEnabled
|
* @param gpsEnabled
|
||||||
*/
|
*/
|
||||||
public void getFileMetadata(boolean gpsEnabled) {
|
public void getFileMetadata(boolean gpsEnabled) {
|
||||||
String filePath = FileUtils.getPath(this, mediaUri);
|
String filePath = FileUtils.getPath(getApplicationContext(), mediaUri);
|
||||||
Timber.d("Filepath: %s", filePath);
|
Timber.d("Filepath: %s", filePath);
|
||||||
Timber.d("Calling GPSExtractor");
|
Timber.d("Calling GPSExtractor");
|
||||||
if(imageObj == null) {
|
if(imageObj == null) {
|
||||||
imageObj = new GPSExtractor(filePath, this);
|
imageObj = new GPSExtractor(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filePath != null && !filePath.equals("")) {
|
if (filePath != null && !filePath.equals("")) {
|
||||||
|
|
@ -402,7 +410,7 @@ public class ShareActivity
|
||||||
app.getCacheData().setQtPoint(decLongitude, decLatitude);
|
app.getCacheData().setQtPoint(decLongitude, decLatitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
MwVolleyApi apiCall = new MwVolleyApi(this);
|
MwVolleyApi apiCall = new MwVolleyApi();
|
||||||
|
|
||||||
List<String> displayCatList = app.getCacheData().findCategory();
|
List<String> displayCatList = app.getCacheData().findCategory();
|
||||||
boolean catListEmpty = displayCatList.isEmpty();
|
boolean catListEmpty = displayCatList.isEmpty();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package fr.free.nrw.commons.upload;
|
package fr.free.nrw.commons.upload;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
@ -26,16 +25,13 @@ import timber.log.Timber;
|
||||||
|
|
||||||
public class UploadController {
|
public class UploadController {
|
||||||
private UploadService uploadService;
|
private UploadService uploadService;
|
||||||
|
private final CommonsApplication app;
|
||||||
private final Activity activity;
|
|
||||||
final CommonsApplication app;
|
|
||||||
|
|
||||||
public interface ContributionUploadProgress {
|
public interface ContributionUploadProgress {
|
||||||
void onUploadStarted(Contribution contribution);
|
void onUploadStarted(Contribution contribution);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UploadController(Activity activity) {
|
public UploadController() {
|
||||||
this.activity = activity;
|
|
||||||
app = CommonsApplication.getInstance();
|
app = CommonsApplication.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,15 +51,15 @@ public class UploadController {
|
||||||
};
|
};
|
||||||
|
|
||||||
public void prepareService() {
|
public void prepareService() {
|
||||||
Intent uploadServiceIntent = new Intent(activity, UploadService.class);
|
Intent uploadServiceIntent = new Intent(app, UploadService.class);
|
||||||
uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE);
|
uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE);
|
||||||
activity.startService(uploadServiceIntent);
|
app.startService(uploadServiceIntent);
|
||||||
activity.bindService(uploadServiceIntent, uploadServiceConnection, Context.BIND_AUTO_CREATE);
|
app.bindService(uploadServiceIntent, uploadServiceConnection, Context.BIND_AUTO_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanup() {
|
public void cleanup() {
|
||||||
if(isUploadServiceConnected) {
|
if(isUploadServiceConnected) {
|
||||||
activity.unbindService(uploadServiceConnection);
|
app.unbindService(uploadServiceConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,7 +78,7 @@ public class UploadController {
|
||||||
|
|
||||||
public void startUpload(final Contribution contribution, final ContributionUploadProgress onComplete) {
|
public void startUpload(final Contribution contribution, final ContributionUploadProgress onComplete) {
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app);
|
||||||
|
|
||||||
//Set creator, desc, and license
|
//Set creator, desc, and license
|
||||||
if(TextUtils.isEmpty(contribution.getCreator())) {
|
if(TextUtils.isEmpty(contribution.getCreator())) {
|
||||||
|
|
@ -107,10 +103,13 @@ public class UploadController {
|
||||||
long length;
|
long length;
|
||||||
try {
|
try {
|
||||||
if(contribution.getDataLength() <= 0) {
|
if(contribution.getDataLength() <= 0) {
|
||||||
length = activity.getContentResolver().openAssetFileDescriptor(contribution.getLocalUri(), "r").getLength();
|
length = app.getContentResolver()
|
||||||
|
.openAssetFileDescriptor(contribution.getLocalUri(), "r")
|
||||||
|
.getLength();
|
||||||
if(length == -1) {
|
if(length == -1) {
|
||||||
// Let us find out the long way!
|
// Let us find out the long way!
|
||||||
length = Utils.countBytes(activity.getContentResolver().openInputStream(contribution.getLocalUri()));
|
length = Utils.countBytes(app.getContentResolver()
|
||||||
|
.openInputStream(contribution.getLocalUri()));
|
||||||
}
|
}
|
||||||
contribution.setDataLength(length);
|
contribution.setDataLength(length);
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +125,7 @@ public class UploadController {
|
||||||
Boolean imagePrefix = false;
|
Boolean imagePrefix = false;
|
||||||
|
|
||||||
if(mimeType == null || TextUtils.isEmpty(mimeType) || mimeType.endsWith("*")) {
|
if(mimeType == null || TextUtils.isEmpty(mimeType) || mimeType.endsWith("*")) {
|
||||||
mimeType = activity.getContentResolver().getType(contribution.getLocalUri());
|
mimeType = app.getContentResolver().getType(contribution.getLocalUri());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mimeType != null) {
|
if(mimeType != null) {
|
||||||
|
|
@ -136,7 +135,7 @@ public class UploadController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imagePrefix && contribution.getDateCreated() == null) {
|
if(imagePrefix && contribution.getDateCreated() == null) {
|
||||||
Cursor cursor = activity.getContentResolver().query(contribution.getLocalUri(),
|
Cursor cursor = app.getContentResolver().query(contribution.getLocalUri(),
|
||||||
new String[]{MediaStore.Images.ImageColumns.DATE_TAKEN}, null, null, null);
|
new String[]{MediaStore.Images.ImageColumns.DATE_TAKEN}, null, null, null);
|
||||||
if(cursor != null && cursor.getCount() != 0) {
|
if(cursor != null && cursor.getCount() != 0) {
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,7 @@
|
||||||
android:id="@+id/backgroundImage"
|
android:id="@+id/backgroundImage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:actualImageScaleType="centerCrop"
|
app:actualImageScaleType="centerCrop" />
|
||||||
app:placeholderImage="@drawable/ic_image_black_24dp"
|
|
||||||
app:failureImage="@drawable/ic_error_outline_black_24dp" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/single_upload_fragment_container"
|
android:id="@+id/single_upload_fragment_container"
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:actualImageScaleType="fitCenter"
|
app:actualImageScaleType="fitCenter"
|
||||||
app:placeholderImage="@drawable/ic_image_black_24dp"
|
|
||||||
app:failureImage="@drawable/ic_image_black_24dp"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="240dp"
|
android:layout_height="240dp"
|
||||||
app:actualImageScaleType="centerCrop"
|
app:actualImageScaleType="centerCrop"
|
||||||
app:placeholderImage="@drawable/ic_image_black_24dp"
|
|
||||||
app:failureImage="@drawable/ic_image_black_24dp"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="192dp"
|
android:layout_height="192dp"
|
||||||
app:actualImageScaleType="centerCrop"
|
app:actualImageScaleType="centerCrop"
|
||||||
app:placeholderImage="@drawable/ic_image_black_24dp"
|
|
||||||
app:failureImage="@drawable/ic_error_outline_black_24dp"
|
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:contentDescription="@string/upload_image"
|
android:contentDescription="@string/upload_image"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue