Browse Source

Merge branch 'drawer-button' into develop

pull/71/merge
Ezerous 4 years ago
parent
commit
7e78c355d8
  1. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  2. 5
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java
  3. 18
      app/src/main/res/layout/activity_main.xml
  4. 1
      app/src/main/res/values/strings.xml
  5. 2
      app/src/main/res/values/styles.xml

6
app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java

@ -5,6 +5,8 @@ import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast; import android.widget.Toast;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
@ -84,6 +86,10 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
return; //Avoid executing the code below return; //Avoid executing the code below
} }
toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
//Initialize drawer //Initialize drawer
createDrawer(); createDrawer();

5
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -721,11 +721,10 @@ public abstract class BaseActivity extends AppCompatActivity {
@Override @Override
public void onRequestPermissionsResult(int permsRequestCode, @NonNull String[] permissions public void onRequestPermissionsResult(int permsRequestCode, @NonNull String[] permissions
, @NonNull int[] grantResults) { , @NonNull int[] grantResults) {
switch (permsRequestCode) { super.onRequestPermissionsResult(permsRequestCode, permissions, grantResults);
case DOWNLOAD_REQUEST_CODE: if (permsRequestCode == DOWNLOAD_REQUEST_CODE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
prepareDownload(tempThmmyFile); prepareDownload(tempThmmyFile);
break;
} }
} }

18
app/src/main/res/layout/activity_main.xml

@ -14,16 +14,32 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/ToolbarTheme"> android:theme="@style/ToolbarTheme">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="@style/ToolbarTheme"/>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tabs" android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1.0"
app:tabMaxWidth="0dp" app:tabMaxWidth="0dp"
app:tabGravity="fill" app:tabGravity="fill"
app:tabMode="fixed" app:tabMode="fixed"
app:tabSelectedTextColor="@color/accent" app:tabSelectedTextColor="@color/accent"
app:tabTextColor="@color/white" app:tabTextColor="@color/white"
app:tabIconTint="@color/activity_main_tabs_selector" /> app:tabIconTint="@color/activity_main_tabs_selector" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager

1
app/src/main/res/values/strings.xml

@ -234,5 +234,4 @@
<!--SessionManager--> <!--SessionManager-->
<string name="session_shared_prefs">SessionSharedPrefs</string> <string name="session_shared_prefs">SessionSharedPrefs</string>
</resources> </resources>

2
app/src/main/res/values/styles.xml

@ -57,7 +57,7 @@
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light"> <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorPrimary">@android:color/white</item> <item name="android:textColorPrimary">@android:color/white</item>
<item name="android:colorBackground">@color/colorPrimary</item> <item name="android:colorBackground">@color/primary</item>
<item name="colorControlNormal">@android:color/white</item> <item name="colorControlNormal">@android:color/white</item>
</style> </style>

Loading…
Cancel
Save