mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge pull request #796 from akaita/media_detail_enhance
Enhance behaviour of Media detail enhance
This commit is contained in:
commit
e3455b630e
7 changed files with 264 additions and 110 deletions
|
|
@ -30,6 +30,7 @@ import fr.free.nrw.commons.MediaWikiImageView;
|
||||||
import fr.free.nrw.commons.PageTitle;
|
import fr.free.nrw.commons.PageTitle;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import fr.free.nrw.commons.location.LatLng;
|
import fr.free.nrw.commons.location.LatLng;
|
||||||
|
import fr.free.nrw.commons.ui.widget.CompatTextView;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class MediaDetailFragment extends Fragment {
|
public class MediaDetailFragment extends Fragment {
|
||||||
|
|
@ -211,22 +212,8 @@ public class MediaDetailFragment extends Fragment {
|
||||||
if (success) {
|
if (success) {
|
||||||
extractor.fill(media);
|
extractor.fill(media);
|
||||||
|
|
||||||
// Set text of desc, license, and categories
|
setTextFields(media);
|
||||||
desc.setText(prettyDescription(media));
|
setOnClickListeners(media);
|
||||||
license.setText(prettyLicense(media));
|
|
||||||
coordinates.setText(prettyCoordinates(media));
|
|
||||||
uploadedDate.setText(prettyUploadedDate(media));
|
|
||||||
|
|
||||||
categoryNames.clear();
|
|
||||||
categoryNames.addAll(media.getCategories());
|
|
||||||
|
|
||||||
categoriesLoaded = true;
|
|
||||||
categoriesPresent = (categoryNames.size() > 0);
|
|
||||||
if (!categoriesPresent) {
|
|
||||||
// Stick in a filler element.
|
|
||||||
categoryNames.add(getString(R.string.detail_panel_cats_none));
|
|
||||||
}
|
|
||||||
rebuildCatList();
|
|
||||||
} else {
|
} else {
|
||||||
Timber.d("Failed to load photo details.");
|
Timber.d("Failed to load photo details.");
|
||||||
}
|
}
|
||||||
|
|
@ -260,6 +247,31 @@ public class MediaDetailFragment extends Fragment {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setTextFields(Media media) {
|
||||||
|
desc.setText(prettyDescription(media));
|
||||||
|
license.setText(prettyLicense(media));
|
||||||
|
coordinates.setText(prettyCoordinates(media));
|
||||||
|
uploadedDate.setText(prettyUploadedDate(media));
|
||||||
|
|
||||||
|
categoryNames.clear();
|
||||||
|
categoryNames.addAll(media.getCategories());
|
||||||
|
|
||||||
|
categoriesLoaded = true;
|
||||||
|
categoriesPresent = (categoryNames.size() > 0);
|
||||||
|
if (!categoriesPresent) {
|
||||||
|
// Stick in a filler element.
|
||||||
|
categoryNames.add(getString(R.string.detail_panel_cats_none));
|
||||||
|
}
|
||||||
|
rebuildCatList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setOnClickListeners(final Media media) {
|
||||||
|
license.setOnClickListener(v -> openWebBrowser(licenseLink(media)));
|
||||||
|
if (media.getCoordinates() != null) {
|
||||||
|
coordinates.setOnClickListener(v -> openMap(media.getCoordinates()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void rebuildCatList() {
|
private void rebuildCatList() {
|
||||||
categoryContainer.removeAllViews();
|
categoryContainer.removeAllViews();
|
||||||
// @fixme add the category items
|
// @fixme add the category items
|
||||||
|
|
@ -271,7 +283,7 @@ public class MediaDetailFragment extends Fragment {
|
||||||
|
|
||||||
private View buildCatLabel(final String catName) {
|
private View buildCatLabel(final String catName) {
|
||||||
final View item = getLayoutInflater(null).inflate(R.layout.detail_category_item, null, false);
|
final View item = getLayoutInflater(null).inflate(R.layout.detail_category_item, null, false);
|
||||||
final TextView textView = (TextView)item.findViewById(R.id.mediaDetailCategoryItemText);
|
final CompatTextView textView = (CompatTextView)item.findViewById(R.id.mediaDetailCategoryItemText);
|
||||||
|
|
||||||
textView.setText(catName);
|
textView.setText(catName);
|
||||||
if (categoriesLoaded && categoriesPresent) {
|
if (categoriesLoaded && categoriesPresent) {
|
||||||
|
|
@ -342,4 +354,34 @@ public class MediaDetailFragment extends Fragment {
|
||||||
}
|
}
|
||||||
return media.getCoordinates().getPrettyCoordinateString();
|
return media.getCoordinates().getPrettyCoordinateString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private @Nullable String licenseLink(Media media) {
|
||||||
|
String licenseKey = media.getLicense();
|
||||||
|
if (licenseKey == null || licenseKey.equals("")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
License licenseObj = licenseList.get(licenseKey);
|
||||||
|
if (licenseObj == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return licenseObj.getUrl(Locale.getDefault().getLanguage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openWebBrowser(String url) {
|
||||||
|
Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
startActivity(browser);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openMap(LatLng coordinates) {
|
||||||
|
//Open map app at given position
|
||||||
|
Uri gmmIntentUri = Uri.parse(
|
||||||
|
"geo:0,0?q=" + coordinates.getLatitude() + "," + coordinates.getLatitude());
|
||||||
|
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
|
||||||
|
|
||||||
|
if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
||||||
|
startActivity(mapIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
package fr.free.nrw.commons.ui.widget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mikel on 07/08/2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.view.ViewCompat;
|
||||||
|
import android.support.v7.widget.AppCompatDrawableManager;
|
||||||
|
import android.support.v7.widget.AppCompatTextView;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.R;
|
||||||
|
import fr.free.nrw.commons.utils.UiUtils;
|
||||||
|
|
||||||
|
public class CompatTextView extends AppCompatTextView {
|
||||||
|
public CompatTextView(Context context) {
|
||||||
|
super(context);
|
||||||
|
init(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompatTextView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init(attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompatTextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init(attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(@Nullable AttributeSet attrs) {
|
||||||
|
if (attrs != null) {
|
||||||
|
Context context = getContext();
|
||||||
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CompatTextView);
|
||||||
|
|
||||||
|
// Obtain DrawableManager used to pull Drawables safely, and check if we're in RTL
|
||||||
|
AppCompatDrawableManager dm = AppCompatDrawableManager.get();
|
||||||
|
boolean rtl = ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_RTL;
|
||||||
|
|
||||||
|
// Grab the compat drawable padding from the XML
|
||||||
|
float drawablePadding = a.getDimension(R.styleable.CompatTextView_drawablePadding, 0);
|
||||||
|
|
||||||
|
// Grab the compat drawable resources from the XML
|
||||||
|
int startDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableStart, 0);
|
||||||
|
int topDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableTop, 0);
|
||||||
|
int endDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableEnd, 0);
|
||||||
|
int bottomDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableBottom, 0);
|
||||||
|
|
||||||
|
// Load the used drawables, fall back to whatever was set in an "android:"
|
||||||
|
Drawable[] currentDrawables = getCompoundDrawables();
|
||||||
|
Drawable left = startDrawableRes != 0
|
||||||
|
? dm.getDrawable(context, startDrawableRes) : currentDrawables[0];
|
||||||
|
Drawable right = endDrawableRes != 0
|
||||||
|
? dm.getDrawable(context, endDrawableRes) : currentDrawables[1];
|
||||||
|
Drawable top = topDrawableRes != 0
|
||||||
|
? dm.getDrawable(context, topDrawableRes) : currentDrawables[2];
|
||||||
|
Drawable bottom = bottomDrawableRes != 0
|
||||||
|
? dm.getDrawable(context, bottomDrawableRes) : currentDrawables[3];
|
||||||
|
|
||||||
|
// Account for RTL and apply the compound Drawables
|
||||||
|
Drawable start = rtl ? right : left;
|
||||||
|
Drawable end = rtl ? left : right;
|
||||||
|
setCompoundDrawablesWithIntrinsicBounds(start, top, end, bottom);
|
||||||
|
setCompoundDrawablePadding((int) UiUtils.convertDpToPixel(drawablePadding, getContext()));
|
||||||
|
|
||||||
|
a.recycle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
package fr.free.nrw.commons.utils;
|
package fr.free.nrw.commons.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.support.graphics.drawable.VectorDrawableCompat;
|
import android.support.graphics.drawable.VectorDrawableCompat;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
|
||||||
public class UiUtils {
|
public class UiUtils {
|
||||||
|
|
||||||
|
|
@ -19,4 +21,26 @@ public class UiUtils {
|
||||||
vectorDrawable.draw(canvas);
|
vectorDrawable.draw(canvas);
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts dp unit to equivalent pixels.
|
||||||
|
* @param dp density independent pixels
|
||||||
|
* @param context Context to access display metrics
|
||||||
|
* @return px equivalent to dp value
|
||||||
|
*/
|
||||||
|
public static float convertDpToPixel(float dp, Context context) {
|
||||||
|
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||||
|
return dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts device specific pixels to dp.
|
||||||
|
* @param px pixels
|
||||||
|
* @param context Context to access display metrics
|
||||||
|
* @return dp equivalent to px value
|
||||||
|
*/
|
||||||
|
public static float convertPixelsToDp(float px, Context context) {
|
||||||
|
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||||
|
return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
app/src/main/res/drawable/ic_info_outline_white_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_info_outline_white_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||||
|
</vector>
|
||||||
|
|
@ -1,20 +1,24 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<fr.free.nrw.commons.ui.widget.CompatTextView
|
||||||
|
android:id="@+id/mediaDetailCategoryItemText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/subBackground"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:minHeight="48dp"
|
android:minHeight="48dp"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:id="@+id/mediaDetailCategoryItemText"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:background="?attr/subBackground"
|
android:textSize="14sp"
|
||||||
|
app:drawablePadding="6dp"
|
||||||
|
app:drawableStart="@drawable/ic_info_outline_white_24dp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
|
|
|
||||||
|
|
@ -26,227 +26,221 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
android:id="@+id/mediaDetailScrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/mediaDetailScrollView"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:cacheColorHint="@android:color/transparent"
|
android:cacheColorHint="@android:color/transparent"
|
||||||
>
|
android:fillViewport="true">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- Placeholder. Height gets set at runtime based on container size; the initial value is a hack to keep
|
<!-- Placeholder. Height gets set at runtime based on container size; the initial value is a hack to keep
|
||||||
the detail info offscreen until it's placed properly. May be a better way to do this. -->
|
the detail info offscreen until it's placed properly. May be a better way to do this. -->
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:id="@+id/mediaDetailSpacer"
|
android:id="@+id/mediaDetailSpacer"
|
||||||
/>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="16dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/fragmentCategorisationBackground"
|
android:background="?attr/fragmentCategorisationBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:text="@string/media_detail_title"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingBottom="6dp"
|
android:paddingBottom="6dp"
|
||||||
/>
|
android:text="@string/media_detail_title"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/mediaDetailTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/media_detail_media_title"
|
|
||||||
android:id="@+id/mediaDetailTitle"
|
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:textSize="14sp"
|
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
/>
|
android:text="@string/media_detail_media_title"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
android:text="@string/media_detail_description"
|
android:text="@string/media_detail_description"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold" />
|
||||||
android:paddingBottom="6dp"
|
|
||||||
/>
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/mediaDetailDesc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/media_detail_description_explanation"
|
|
||||||
android:background="?attr/subBackground"
|
|
||||||
android:id="@+id/mediaDetailDesc"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:textSize="14sp"
|
android:background="?attr/subBackground"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
/>
|
android:text="@string/media_detail_description_explanation"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
android:text="@string/media_detail_license"
|
android:text="@string/media_detail_license"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold" />
|
||||||
android:paddingBottom="6dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<fr.free.nrw.commons.ui.widget.CompatTextView
|
||||||
android:id="@+id/mediaDetailLicense"
|
android:id="@+id/mediaDetailLicense"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="12dp"
|
||||||
android:text="@string/media_detail_license"
|
android:text="@string/media_detail_license"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:padding="12dp"
|
app:drawablePadding="6dp"
|
||||||
|
app:drawableStart="@drawable/ic_info_outline_white_24dp"
|
||||||
tools:text="License link" />
|
tools:text="License link" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:text="@string/media_detail_coordinates"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingBottom="6dp"
|
android:paddingBottom="6dp"
|
||||||
/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/media_detail_coordinates"
|
android:text="@string/media_detail_coordinates"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<fr.free.nrw.commons.ui.widget.CompatTextView
|
||||||
android:id="@+id/mediaDetailCoordinates"
|
android:id="@+id/mediaDetailCoordinates"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/media_detail_coordinates"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:padding="12dp"
|
app:drawablePadding="6dp"
|
||||||
tools:text="Coordinates link"
|
app:drawableStart="@drawable/ic_map_white_24dp"
|
||||||
/>
|
tools:text="Coordinates link" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
|
android:orientation="vertical"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold">
|
||||||
>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
android:text="@string/detail_panel_cats_label"
|
android:text="@string/detail_panel_cats_label"
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_gravity="start"
|
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:paddingBottom="6dp"
|
android:textSize="16sp"
|
||||||
/>
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:id="@+id/mediaDetailCategoryContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/mediaDetailCategoryContainer"
|
android:orientation="vertical" />
|
||||||
/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<fr.free.nrw.commons.media.MediaDetailSpacer
|
<fr.free.nrw.commons.media.MediaDetailSpacer
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/subBackground"
|
android:background="?attr/subBackground"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
android:text="@string/media_detail_uploaded_date"
|
android:text="@string/media_detail_uploaded_date"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold" />
|
||||||
android:paddingBottom="6dp"
|
|
||||||
/>
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/mediaDetailuploadeddate"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/media_detail_uploaded_date"
|
|
||||||
android:background="?attr/subBackground"
|
|
||||||
android:id="@+id/mediaDetailuploadeddate"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:textSize="14sp"
|
android:background="?attr/subBackground"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
/>
|
android:text="@string/media_detail_uploaded_date"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,12 @@
|
||||||
<attr name="iconCamera" format="reference"/>
|
<attr name="iconCamera" format="reference"/>
|
||||||
<attr name="iconPhoto" format="reference"/>
|
<attr name="iconPhoto" format="reference"/>
|
||||||
<attr name="iconUndo" format="reference"/>
|
<attr name="iconUndo" format="reference"/>
|
||||||
|
|
||||||
|
<declare-styleable name="CompatTextView">
|
||||||
|
<attr name="drawablePadding" format="dimension"/>
|
||||||
|
<attr name="drawableStart" format="reference"/>
|
||||||
|
<attr name="drawableTop" format="reference"/>
|
||||||
|
<attr name="drawableEnd" format="reference"/>
|
||||||
|
<attr name="drawableBottom" format="reference"/>
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue