mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
With NavigationBaseActivity implemented
This commit is contained in:
parent
09cd596ff6
commit
a6bbc8a33b
12 changed files with 241 additions and 218 deletions
|
|
@ -7,9 +7,9 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||||
|
|
||||||
public class AboutActivity extends BaseActivity {
|
public class AboutActivity extends NavigationBaseActivity {
|
||||||
@BindView(R.id.about_version) TextView versionText;
|
@BindView(R.id.about_version) TextView versionText;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -20,6 +20,7 @@ public class AboutActivity extends BaseActivity {
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
versionText.setText(BuildConfig.VERSION_NAME);
|
versionText.setText(BuildConfig.VERSION_NAME);
|
||||||
|
initDrawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startYourself(Context context) {
|
public static void startYourself(Context context) {
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,9 @@ import java.io.IOException;
|
||||||
|
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.BaseActivity;
|
||||||
import fr.free.nrw.commons.CommonsApplication;
|
import fr.free.nrw.commons.CommonsApplication;
|
||||||
|
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||||
|
|
||||||
public abstract class AuthenticatedActivity extends BaseActivity {
|
public abstract class AuthenticatedActivity extends NavigationBaseActivity {
|
||||||
|
|
||||||
String accountType;
|
String accountType;
|
||||||
CommonsApplication app;
|
CommonsApplication app;
|
||||||
|
|
|
||||||
|
|
@ -16,20 +16,15 @@ import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Adapter;
|
import android.widget.Adapter;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import fr.free.nrw.commons.CommonsApplication;
|
import fr.free.nrw.commons.CommonsApplication;
|
||||||
import fr.free.nrw.commons.HandlerService;
|
import fr.free.nrw.commons.HandlerService;
|
||||||
|
|
@ -37,15 +32,11 @@ import fr.free.nrw.commons.Media;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import fr.free.nrw.commons.auth.AuthenticatedActivity;
|
import fr.free.nrw.commons.auth.AuthenticatedActivity;
|
||||||
import fr.free.nrw.commons.hamburger.HamburgerMenuContainer;
|
import fr.free.nrw.commons.hamburger.HamburgerMenuContainer;
|
||||||
import fr.free.nrw.commons.hamburger.NavigationBaseFragment;
|
|
||||||
import fr.free.nrw.commons.media.MediaDetailPagerFragment;
|
import fr.free.nrw.commons.media.MediaDetailPagerFragment;
|
||||||
import fr.free.nrw.commons.settings.Prefs;
|
import fr.free.nrw.commons.settings.Prefs;
|
||||||
import fr.free.nrw.commons.upload.UploadService;
|
import fr.free.nrw.commons.upload.UploadService;
|
||||||
import fr.free.nrw.commons.utils.FragmentUtils;
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
import static android.support.v4.view.GravityCompat.START;
|
|
||||||
|
|
||||||
public class ContributionsActivity
|
public class ContributionsActivity
|
||||||
extends AuthenticatedActivity
|
extends AuthenticatedActivity
|
||||||
implements LoaderManager.LoaderCallbacks<Cursor>,
|
implements LoaderManager.LoaderCallbacks<Cursor>,
|
||||||
|
|
@ -63,15 +54,6 @@ public class ContributionsActivity
|
||||||
private ArrayList<DataSetObserver> observersWaitingForLoad = new ArrayList<>();
|
private ArrayList<DataSetObserver> observersWaitingForLoad = new ArrayList<>();
|
||||||
private String CONTRIBUTION_SELECTION = "";
|
private String CONTRIBUTION_SELECTION = "";
|
||||||
|
|
||||||
@BindView(R.id.contributions_toolbar)
|
|
||||||
Toolbar toolbar;
|
|
||||||
|
|
||||||
@BindView(R.id.drawer_layout)
|
|
||||||
DrawerLayout drawerLayout;
|
|
||||||
|
|
||||||
@BindView(R.id.drawer_pane)
|
|
||||||
RelativeLayout drawerPane;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This sorts in the following order:
|
This sorts in the following order:
|
||||||
Currently Uploading
|
Currently Uploading
|
||||||
|
|
@ -144,12 +126,6 @@ public class ContributionsActivity
|
||||||
setContentView(R.layout.activity_contributions);
|
setContentView(R.layout.activity_contributions);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
|
|
||||||
initSubviews();
|
|
||||||
|
|
||||||
// Activity can call methods in the fragment by acquiring a reference to the Fragment from FragmentManager, using findFragmentById()
|
// Activity can call methods in the fragment by acquiring a reference to the Fragment from FragmentManager, using findFragmentById()
|
||||||
contributionsList = (ContributionsListFragment)getSupportFragmentManager().findFragmentById(R.id.contributionsListFragment);
|
contributionsList = (ContributionsListFragment)getSupportFragmentManager().findFragmentById(R.id.contributionsListFragment);
|
||||||
|
|
||||||
|
|
@ -164,30 +140,7 @@ public class ContributionsActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requestAuthToken();
|
requestAuthToken();
|
||||||
NavigationBaseFragment baseFragment = new NavigationBaseFragment();
|
initDrawer();
|
||||||
baseFragment.setDrawerLayout(drawerLayout, drawerPane);
|
|
||||||
FragmentUtils.addAndCommitFragmentWithImmediateExecution(getSupportFragmentManager(),
|
|
||||||
R.id.drawer_fragment,
|
|
||||||
baseFragment);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initSubviews() {
|
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,
|
|
||||||
drawerLayout,
|
|
||||||
toolbar,
|
|
||||||
R.string.navigation_drawer_open,
|
|
||||||
R.string.navigation_drawer_close);
|
|
||||||
drawerLayout.setDrawerListener(toggle);
|
|
||||||
toggle.setDrawerIndicatorEnabled(true);
|
|
||||||
toggle.syncState();
|
|
||||||
setDrawerPaneWidth();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDrawerPaneWidth() {
|
|
||||||
ViewGroup.LayoutParams params = drawerPane.getLayoutParams();
|
|
||||||
// set width to lowerBound of 80% of the screen size
|
|
||||||
params.width = (getResources().getDisplayMetrics().widthPixels * 70) / 100;
|
|
||||||
drawerPane.setLayoutParams(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -281,15 +234,15 @@ public class ContributionsActivity
|
||||||
((CursorAdapter)contributionsList.getAdapter()).swapCursor(cursor);
|
((CursorAdapter)contributionsList.getAdapter()).swapCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (cursor.getCount() == 0
|
if (cursor.getCount() == 0
|
||||||
// && Locale.getDefault().getISO3Language().equals(Locale.ENGLISH.getISO3Language())) {
|
&& Locale.getDefault().getISO3Language().equals(Locale.ENGLISH.getISO3Language())) {
|
||||||
// //cursor count is zero and language is english -
|
//cursor count is zero and language is english -
|
||||||
// // we need to set the message for 0 case explicitly.
|
// we need to set the message for 0 case explicitly.
|
||||||
// getSupportActionBar().setSubtitle(getResources()
|
getSupportActionBar().setSubtitle(getResources()
|
||||||
// .getString(R.string.contributions_subtitle_zero));
|
.getString(R.string.contributions_subtitle_zero));
|
||||||
// } else {
|
} else {
|
||||||
// getSupportActionBar().setSubtitle(getResources().getQuantityString(R.plurals.contributions_subtitle, cursor.getCount(), cursor.getCount()));
|
getSupportActionBar().setSubtitle(getResources().getQuantityString(R.plurals.contributions_subtitle, cursor.getCount(), cursor.getCount()));
|
||||||
// }
|
}
|
||||||
|
|
||||||
contributionsList.clearSyncMessage();
|
contributionsList.clearSyncMessage();
|
||||||
notifyAndMigrateDataSetObservers();
|
notifyAndMigrateDataSetObservers();
|
||||||
|
|
@ -373,25 +326,6 @@ public class ContributionsActivity
|
||||||
getSupportLoaderManager().restartLoader(0, null, this);
|
getSupportLoaderManager().restartLoader(0, null, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDrawerListener(ActionBarDrawerToggle listener) {
|
|
||||||
drawerLayout.setDrawerListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toggleDrawer() {
|
|
||||||
if (drawerLayout.isDrawerVisible(START)) {
|
|
||||||
drawerLayout.closeDrawer(START);
|
|
||||||
} else {
|
|
||||||
drawerLayout.openDrawer(START);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isDrawerVisible() {
|
|
||||||
return drawerLayout.isDrawerVisible(START);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startYourself(Context context) {
|
public static void startYourself(Context context) {
|
||||||
Intent settingsIntent = new Intent(context, ContributionsActivity.class);
|
Intent settingsIntent = new Intent(context, ContributionsActivity.class);
|
||||||
context.startActivity(settingsIntent);
|
context.startActivity(settingsIntent);
|
||||||
|
|
|
||||||
|
|
@ -126,46 +126,6 @@ public class ContributionsListFragment extends Fragment {
|
||||||
case R.id.menu_from_camera:
|
case R.id.menu_from_camera:
|
||||||
controller.startCameraCapture();
|
controller.startCameraCapture();
|
||||||
return true;
|
return true;
|
||||||
// case R.id.menu_settings:
|
|
||||||
// Intent settingsIntent = new Intent(getActivity(), SettingsActivity.class);
|
|
||||||
// startActivity(settingsIntent);
|
|
||||||
// return true;
|
|
||||||
// case R.id.menu_about:
|
|
||||||
// Intent aboutIntent = new Intent(getActivity(), AboutActivity.class);
|
|
||||||
// startActivity(aboutIntent);
|
|
||||||
// return true;
|
|
||||||
// case R.id.menu_feedback:
|
|
||||||
// Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
|
|
||||||
// feedbackIntent.setType("message/rfc822");
|
|
||||||
// feedbackIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { CommonsApplication.FEEDBACK_EMAIL });
|
|
||||||
// feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, BuildConfig.VERSION_NAME));
|
|
||||||
// try {
|
|
||||||
// startActivity(feedbackIntent);
|
|
||||||
// }
|
|
||||||
// catch (ActivityNotFoundException e) {
|
|
||||||
// Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// case R.id.menu_nearby:
|
|
||||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
// if (ContextCompat.checkSelfPermission(this.getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// //See http://stackoverflow.com/questions/33169455/onrequestpermissionsresult-not-being-called-in-dialog-fragment
|
|
||||||
// requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);
|
|
||||||
// return true;
|
|
||||||
// } else {
|
|
||||||
// Intent nearbyIntent = new Intent(getActivity(), NearbyActivity.class);
|
|
||||||
// startActivity(nearbyIntent);
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// Intent nearbyIntent = new Intent(getActivity(), NearbyActivity.class);
|
|
||||||
// startActivity(nearbyIntent);
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// case R.id.menu_refresh:
|
|
||||||
// ((SourceRefresher)getActivity()).refreshSource();
|
|
||||||
// return true;
|
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
@ -203,8 +163,6 @@ public class ContributionsListFragment extends Fragment {
|
||||||
if (!app.deviceHasCamera()) {
|
if (!app.deviceHasCamera()) {
|
||||||
menu.findItem(R.id.menu_from_camera).setEnabled(false);
|
menu.findItem(R.id.menu_from_camera).setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//menu.findItem(R.id.menu_refresh).setVisible(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ public class NavigationBaseFragment extends Fragment {
|
||||||
@BindView(R.id.pictureOfTheDay)
|
@BindView(R.id.pictureOfTheDay)
|
||||||
ImageView pictureOfTheDay;
|
ImageView pictureOfTheDay;
|
||||||
|
|
||||||
@BindView(R.id.home_item)
|
|
||||||
TextView homeItem;
|
|
||||||
|
|
||||||
@BindView(R.id.upload_item)
|
@BindView(R.id.upload_item)
|
||||||
TextView uploadItem;
|
TextView uploadItem;
|
||||||
|
|
||||||
|
|
@ -83,7 +80,7 @@ public class NavigationBaseFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.upload_item)
|
@OnClick(R.id.upload_item)
|
||||||
protected void onHomeItemClicked() {
|
protected void onUploadItemClicked() {
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
ContributionsActivity.startYourself(getActivity());
|
ContributionsActivity.startYourself(getActivity());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,11 @@ import butterknife.ButterKnife;
|
||||||
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.location.LocationServiceManager;
|
import fr.free.nrw.commons.location.LocationServiceManager;
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||||
import fr.free.nrw.commons.utils.UriSerializer;
|
import fr.free.nrw.commons.utils.UriSerializer;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class NearbyActivity extends BaseActivity {
|
public class NearbyActivity extends NavigationBaseActivity {
|
||||||
@BindView(R.id.progressBar)
|
@BindView(R.id.progressBar)
|
||||||
ProgressBar progressBar;
|
ProgressBar progressBar;
|
||||||
private boolean isMapViewActive = false;
|
private boolean isMapViewActive = false;
|
||||||
|
|
@ -59,7 +59,7 @@ public class NearbyActivity extends BaseActivity {
|
||||||
curLatLang = locationManager.getLatestLocation();
|
curLatLang = locationManager.getLatestLocation();
|
||||||
nearbyAsyncTask = new NearbyAsyncTask(this);
|
nearbyAsyncTask = new NearbyAsyncTask(this);
|
||||||
nearbyAsyncTask.execute();
|
nearbyAsyncTask.execute();
|
||||||
|
initDrawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package fr.free.nrw.commons.theme;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.widget.DrawerLayout;
|
||||||
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import fr.free.nrw.commons.R;
|
||||||
|
import fr.free.nrw.commons.hamburger.HamburgerMenuContainer;
|
||||||
|
import fr.free.nrw.commons.hamburger.NavigationBaseFragment;
|
||||||
|
import fr.free.nrw.commons.utils.FragmentUtils;
|
||||||
|
|
||||||
|
import static android.support.v4.view.GravityCompat.START;
|
||||||
|
|
||||||
|
public class NavigationBaseActivity extends BaseActivity implements HamburgerMenuContainer {
|
||||||
|
@BindView(R.id.toolbar)
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
|
@BindView(R.id.drawer_layout)
|
||||||
|
DrawerLayout drawerLayout;
|
||||||
|
|
||||||
|
@BindView(R.id.drawer_pane)
|
||||||
|
RelativeLayout drawerPane;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initDrawer() {
|
||||||
|
initSubviews();
|
||||||
|
NavigationBaseFragment baseFragment = new NavigationBaseFragment();
|
||||||
|
baseFragment.setDrawerLayout(drawerLayout, drawerPane);
|
||||||
|
FragmentUtils.addAndCommitFragmentWithImmediateExecution(getSupportFragmentManager(),
|
||||||
|
R.id.drawer_fragment,
|
||||||
|
baseFragment);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSubviews() {
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,
|
||||||
|
drawerLayout,
|
||||||
|
toolbar,
|
||||||
|
R.string.navigation_drawer_open,
|
||||||
|
R.string.navigation_drawer_close);
|
||||||
|
drawerLayout.setDrawerListener(toggle);
|
||||||
|
toggle.setDrawerIndicatorEnabled(true);
|
||||||
|
toggle.syncState();
|
||||||
|
setDrawerPaneWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDrawerPaneWidth() {
|
||||||
|
ViewGroup.LayoutParams params = drawerPane.getLayoutParams();
|
||||||
|
// set width to lowerBound of 80% of the screen size
|
||||||
|
params.width = (getResources().getDisplayMetrics().widthPixels * 70) / 100;
|
||||||
|
drawerPane.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDrawerListener(ActionBarDrawerToggle listener) {
|
||||||
|
drawerLayout.setDrawerListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toggleDrawer() {
|
||||||
|
if (drawerLayout.isDrawerVisible(START)) {
|
||||||
|
drawerLayout.closeDrawer(START);
|
||||||
|
} else {
|
||||||
|
drawerLayout.openDrawer(START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDrawerVisible() {
|
||||||
|
return drawerLayout.isDrawerVisible(START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,71 +1,103 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:id="@+id/drawer_layout"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_marginLeft="12dp"
|
|
||||||
android:layout_marginRight="12dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:src="@drawable/ic_launcher"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:layout_width="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<include
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="wrap_content"
|
layout="@layout/toolbar"
|
||||||
android:text="@string/app_name"
|
android:layout_width="match_parent"
|
||||||
style="?android:textAppearanceLarge"
|
android:layout_height="wrap_content" />
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/about_version"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_below="@id/toolbar"
|
||||||
/>
|
android:layout_marginLeft="12dp"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
<ImageView
|
||||||
android:id="@+id/about_license"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:src="@drawable/ic_launcher" />
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
style="?android:textAppearanceSmall"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/about_license"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
<TextView
|
||||||
android:id="@+id/about_improve"
|
style="?android:textAppearanceLarge"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:text="@string/app_name" />
|
||||||
style="?android:textAppearanceSmall"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/about_improve"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
<TextView
|
||||||
android:id="@+id/about_privacy_policy"
|
android:id="@+id/about_version"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
style="?android:textAppearanceSmall"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/about_privacy_policy"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||||
android:id="@+id/about_credits"
|
android:id="@+id/about_license"
|
||||||
android:layout_width="wrap_content"
|
style="?android:textAppearanceSmall"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_height="wrap_content"
|
||||||
style="?android:textAppearanceSmall"
|
android:layout_marginTop="16dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/about_credits"
|
android:text="@string/about_license" />
|
||||||
/>
|
|
||||||
|
|
||||||
|
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||||
|
android:id="@+id/about_improve"
|
||||||
|
style="?android:textAppearanceSmall"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/about_improve" />
|
||||||
|
|
||||||
</LinearLayout>
|
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||||
|
android:id="@+id/about_privacy_policy"
|
||||||
|
style="?android:textAppearanceSmall"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/about_privacy_policy" />
|
||||||
|
|
||||||
|
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||||
|
android:id="@+id/about_credits"
|
||||||
|
style="?android:textAppearanceSmall"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/about_credits" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/about_uploads_to"
|
||||||
|
style="?android:textAppearanceSmall"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:alpha="0.2"
|
||||||
|
android:gravity="center" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/drawer_pane"
|
||||||
|
android:layout_width="320dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:background="@android:color/white">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/drawer_fragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<include
|
<include
|
||||||
android:id="@+id/contributions_toolbar"
|
android:id="@+id/toolbar"
|
||||||
layout="@layout/contributions_toolbar"
|
layout="@layout/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/contributionsFragmentContainer"
|
android:id="@+id/contributionsFragmentContainer"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_below="@id/contributions_toolbar">
|
android:layout_below="@id/toolbar">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/contributionsListFragment"
|
android:id="@+id/contributionsListFragment"
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,50 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<ProgressBar
|
<RelativeLayout
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:layout_centerInParent="true"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FrameLayout
|
<include
|
||||||
android:id="@+id/container"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
layout="@layout/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_below="@id/toolbar">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"></FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/drawer_pane"
|
||||||
|
android:layout_width="320dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
>
|
android:layout_gravity="start"
|
||||||
</FrameLayout>
|
android:background="@android:color/white">
|
||||||
|
|
||||||
</LinearLayout>
|
<FrameLayout
|
||||||
|
android:id="@+id/drawer_fragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|
@ -27,16 +27,6 @@
|
||||||
android:layout_height="0.5dp"
|
android:layout_height="0.5dp"
|
||||||
android:background="@android:color/black"/>
|
android:background="@android:color/black"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/home_item"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:textSize="20dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:text="@string/navigation_item_home"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/upload_item"
|
android:id="@+id/upload_item"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue