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. 20
      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.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatDelegate;
@ -84,6 +86,10 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
return; //Avoid executing the code below
}
toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
//Initialize drawer
createDrawer();

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

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

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

@ -14,21 +14,37 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
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
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1.0"
app:tabMaxWidth="0dp"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/accent"
app:tabTextColor="@color/white"
app:tabIconTint="@color/activity_main_tabs_selector" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

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

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

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

@ -57,7 +57,7 @@
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
<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>
</style>

Loading…
Cancel
Save