mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Merge pull request #841 from commons-app/revert-826-master
Revert "Adding username to Drawer"
This commit is contained in:
commit
43d3f0592d
3 changed files with 6 additions and 34 deletions
|
|
@ -58,6 +58,7 @@ class LoginTask extends AsyncTask<String, String, String> {
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
Timber.d("Login done!");
|
Timber.d("Login done!");
|
||||||
|
|
||||||
EventLog.schema(CommonsApplication.EVENT_LOGIN_ATTEMPT)
|
EventLog.schema(CommonsApplication.EVENT_LOGIN_ATTEMPT)
|
||||||
.param("username", username)
|
.param("username", username)
|
||||||
.param("result", result)
|
.param("result", result)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package fr.free.nrw.commons.theme;
|
package fr.free.nrw.commons.theme;
|
||||||
|
|
||||||
import android.accounts.Account;
|
|
||||||
import android.accounts.AccountManager;
|
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
@ -12,11 +10,9 @@ import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
|
|
@ -43,15 +39,9 @@ public class NavigationBaseActivity extends BaseActivity
|
||||||
DrawerLayout drawerLayout;
|
DrawerLayout drawerLayout;
|
||||||
|
|
||||||
private ActionBarDrawerToggle toggle;
|
private ActionBarDrawerToggle toggle;
|
||||||
private String username;
|
|
||||||
private TextView usernameTextView;
|
|
||||||
|
|
||||||
public void initDrawer() {
|
public void initDrawer() {
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
username = CommonsApplication.getInstance().getCurrentAccount().name;
|
|
||||||
usernameTextView = ((TextView) navigationView.getHeaderView(0)
|
|
||||||
.findViewById(R.id.userNameText));
|
|
||||||
usernameTextView.setText(username != null ? username : "");
|
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:background="@android:color/darker_gray"
|
|
||||||
android:layout_height="172dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/pictureOfTheDay"
|
android:id="@+id/pictureOfTheDay"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="172dp"
|
||||||
android:layout_weight="0.8"
|
android:background="@android:color/darker_gray"
|
||||||
android:paddingTop="5dp"
|
android:padding="16dp"
|
||||||
android:src="@drawable/commons_logo_large" />
|
android:src="@drawable/commons_logo_large"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/userNameText"
|
|
||||||
style="?android:textAppearanceLargeInverse"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="0.2"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:text="@string/placeholder_place_name"
|
|
||||||
android:textColor="@android:color/white" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue