Browse Source

AboutActivity minro changes

pull/24/head
Ezerous 7 years ago
parent
commit
74a272e313
  1. 49
      app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
  2. 17
      app/src/main/res/layout/activity_about.xml
  3. 9
      app/src/main/res/layout/fragment_unread_mark_read_row.xml

49
app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java

@ -33,7 +33,6 @@ public class AboutActivity extends BaseActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
String versionName = BuildConfig.VERSION_NAME;
String buildType = BuildConfig.BUILD_TYPE;
//Initialize appbar
appBar = findViewById(R.id.appbar);
@ -54,33 +53,33 @@ public class AboutActivity extends BaseActivity {
trollGif = findViewById(R.id.trollPicFrame);
TextView tv = findViewById(R.id.version);
if (tv != null)
{
if(buildType.equals("debug"))
if (tv != null) {
if (BuildConfig.DEBUG)
tv.setText(getString(R.string.version, versionName + "-debug"));
else
tv.setText(getString(R.string.version, versionName));
}
tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mVersionLastPressedTime + TIME_INTERVAL > System.currentTimeMillis()) {
if (mVersionPressedCounter == TIMES_TO_PRESS) {
appBar.setVisibility(View.INVISIBLE);
mainContent.setVisibility(View.INVISIBLE);
trollGif.setVisibility(View.VISIBLE);
drawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mVersionLastPressedTime + TIME_INTERVAL > System.currentTimeMillis()) {
if (mVersionPressedCounter == TIMES_TO_PRESS) {
appBar.setVisibility(View.INVISIBLE);
mainContent.setVisibility(View.INVISIBLE);
trollGif.setVisibility(View.VISIBLE);
drawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
mVersionLastPressedTime = System.currentTimeMillis();
++mVersionPressedCounter;
} else {
mVersionLastPressedTime = System.currentTimeMillis();
mVersionPressedCounter = 0;
}
mVersionLastPressedTime = System.currentTimeMillis();
++mVersionPressedCounter;
} else {
mVersionLastPressedTime = System.currentTimeMillis();
mVersionPressedCounter = 0;
}
}
});
});
}
}
@ -101,7 +100,8 @@ public class AboutActivity extends BaseActivity {
.setView(webView)
.setPositiveButton(android.R.string.ok, null)
.show();
alertDialog.getWindow().setLayout(width, height);
if(alertDialog.getWindow()!=null)
alertDialog.getWindow().setLayout(width, height);
}
public void displayMITLibraries(View v) {
@ -115,7 +115,8 @@ public class AboutActivity extends BaseActivity {
.setView(webView)
.setPositiveButton(android.R.string.ok, null)
.show();
alertDialog.getWindow().setLayout(width, height);
if(alertDialog.getWindow()!=null)
alertDialog.getWindow().setLayout(width, height);
}
}

17
app/src/main/res/layout/activity_about.xml

@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ToolbarTheme"></android.support.v7.widget.Toolbar>
app:popupTheme="@style/ToolbarTheme" />
</android.support.design.widget.AppBarLayout>
@ -28,7 +28,7 @@
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:background="@color/primary_light"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -41,18 +41,15 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.eternalpixels.toinfinity.Info">
<pl.droidsonroids.gif.GifImageView
<ImageView
android:id="@+id/logoView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="15dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:contentDescription="@string/logo"
android:src="@drawable/logo_animated" />
android:layout_alignParentTop="true"
android:src="@mipmap/ic_launcher"
android:contentDescription="@string/logo" />
<TextView
android:id="@+id/version"

9
app/src/main/res/layout/fragment_unread_mark_read_row.xml

@ -2,15 +2,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:paddingTop="7dp">
android:orientation="vertical">
<TextView
android:id="@+id/mark_read"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:paddingTop="7dp"
android:paddingBottom="7dp"
android:textAlignment="center"
android:textColor="@color/accent" />
</LinearLayout>
Loading…
Cancel
Save