Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Icon for Login/Register menu item in ActionBar #952

Open
wants to merge 1 commit into
base: gsoc2022
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 4 additions & 31 deletions org.envirocar.app/res/drawable/ic_baseline_login_24.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--

Copyright (C) 2013 - 2021 the enviroCar community

This file is part of the enviroCar app.

The enviroCar app is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The enviroCar app is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along
with the enviroCar app. If not, see http://www.gnu.org/licenses/.

-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp"
android:height="36dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData = "M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5,-5L11,7zM20,19h-8v2h8c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-8v2h8V19z"
android:fillColor="#FFFFFF"/>
<vector android:height="24dp" android:tint="#0065A0"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#0065A0" android:pathData="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5,-5L11,7zM20,19h-8v2h8c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-8v2h8V19z"/>
</vector>


5 changes: 5 additions & 0 deletions org.envirocar.app/res/drawable/ic_baseline_more_vert_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
25 changes: 17 additions & 8 deletions org.envirocar.app/res/menu/menu_dashboard_logged_out.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".views.BaseMainActivity">

<item
android:id="@+id/dashboard_action_login"
android:orderInCategory="100"
android:title="@string/login_register"
app:showAsAction="collapseActionView" />
xmlns:tools="http://schemas.android.com/tools">

<item android:id="@+id/more"
android:title=""
android:icon="@drawable/ic_baseline_more_vert_24"
app:showAsAction="always"
>

<menu>
<item
android:id="@+id/dashboard_action_login"
android:icon="@drawable/ic_baseline_login_24"
android:title="@string/login_register"
app:showAsAction="ifRoom" />
</menu>

</item>

</menu>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;

Expand Down Expand Up @@ -235,6 +236,12 @@ public void onReceive(Context context, Intent intent) {
registerReceiver(errorInformationReceiver, new IntentFilter(TroubleshootingFragment.INTENT));
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_dashboard_logged_out, menu);
return true;
}

private DisposableObserver<Boolean> handleTermsOfUseValidation() {
return new DisposableObserver<Boolean>() {
@Override
Expand Down