Keep improvements

This commit is contained in:
tom79 2019-11-09 17:36:17 +01:00
parent 3ffe753b29
commit 33f1ca6de5
17 changed files with 36 additions and 74 deletions

View File

@ -1079,14 +1079,12 @@ public abstract class BaseMainActivity extends BaseActivity
return true;
case R.id.action_import_data:
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (ContextCompat.checkSelfPermission(BaseMainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(BaseMainActivity.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
TootActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
return true;
}
if (ContextCompat.checkSelfPermission(BaseMainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(BaseMainActivity.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
TootActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
return true;
}
intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);

View File

@ -116,9 +116,6 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_Fedilab);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;

View File

@ -26,7 +26,6 @@ import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
@ -91,8 +90,6 @@ public class GroupActivity extends BaseActivity implements OnRetrieveFeedsInterf
setContentView(R.layout.activity_group);
Toolbar toolbar = findViewById(R.id.toolbar);
if (theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(GroupActivity.this, R.color.black));
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
@ -167,13 +164,11 @@ public class GroupActivity extends BaseActivity implements OnRetrieveFeedsInterf
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override

View File

@ -14,7 +14,6 @@
* see <http://www.gnu.org/licenses>. */
package app.fedilab.android.activities;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
@ -22,7 +21,6 @@ import android.os.AsyncTask;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -71,9 +69,6 @@ public class OpencollectiveActivity extends BaseActivity implements OnRetrieveRe
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_Fedilab);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
@ -134,13 +129,11 @@ public class OpencollectiveActivity extends BaseActivity implements OnRetrieveRe
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}

View File

@ -96,22 +96,17 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra
private ManageTimelines timeline;
private boolean isLoadingInstance;
private String oldSearch;
private int theme;
private String instance;
private boolean refresh_list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme) {
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_Fedilab);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;

View File

@ -50,7 +50,6 @@ public class TootInfoActivity extends BaseActivity {
private String toot_id;
private TabLayout tabLayout;
private ViewPager mPager;
private String userID;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -78,7 +77,6 @@ public class TootInfoActivity extends BaseActivity {
Toasty.error(getApplicationContext(), getString(R.string.toast_error), Toast.LENGTH_SHORT).show();
finish();
}
userID = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
tabLayout = findViewById(R.id.tabLayout);
mPager = findViewById(R.id.viewpager);
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.reblog) + " (" + toot_reblogs_count + ")"));

View File

@ -4264,7 +4264,7 @@ public class Helper {
final SwitchCompat clean_all = dialogView.findViewById(R.id.clean_all);
final float finalCacheSize = cacheSize;
builder
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
.setPositiveButton(R.string.clear, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// continue with delete
AsyncTask.execute(new Runnable() {

View File

@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="#14161B"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="?attr/iconColor"
android:fillColor="#FFFFFFFF"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z" />
</vector>

View File

@ -30,13 +30,6 @@
android:orientation="vertical"
tools:ignore="UselessParent">
<!-- Profile SETTINGS -->
<TextView
android:text="@string/settings_title_profile"
android:paddingBottom="10dp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content" />
<!-- Screen name -->
<LinearLayout
android:layout_width="match_parent"
@ -53,7 +46,6 @@
<LinearLayout
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

View File

@ -15,7 +15,8 @@
android:id="@+id/back_ground_image"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:contentDescription="@string/logo_of_the_instance" />
</RelativeLayout>
<LinearLayout
android:id="@+id/instance_container"
@ -28,7 +29,6 @@
<TextView
android:id="@+id/name"
android:textSize="20sp"
android:textColor="@color/mastodonC3"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="wrap_content"
@ -36,7 +36,6 @@
<TextView
android:id="@+id/values"
android:textColor="@color/dark_text"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:gravity="center"
@ -45,7 +44,6 @@
<TextView
android:textColor="@color/dark_text"
android:layout_marginTop="10dp"
android:id="@+id/checked_at"
android:layout_gravity="center"
@ -63,7 +61,6 @@
<TextView
android:textColor="@color/dark_text"
android:id="@+id/uptime"
android:layout_marginTop="10dp"
android:layout_gravity="center"
@ -75,7 +72,6 @@
android:id="@+id/ref_instance"
android:layout_gravity="end|center_vertical"
android:text="via instances.social"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="0dp"
@ -84,11 +80,13 @@
<Button
android:layout_marginTop="20dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:id="@+id/close"
android:textSize="16sp"
android:layout_gravity="center"
android:textAllCaps="false"
android:text="@string/close"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

View File

@ -130,7 +130,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin_floating"
app:srcCompat="@drawable/ic_edit"
android:src="@drawable/ic_edit"
tools:ignore="VectorDrawableCompat" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
@ -141,7 +141,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin_floating"
app:srcCompat="@drawable/ic_delete_floating"
android:src="@drawable/ic_delete_floating"
tools:ignore="VectorDrawableCompat" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
@ -152,7 +152,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin_floating"
app:srcCompat="@drawable/ic_action_add_new"
android:src="@drawable/ic_action_add_new"
tools:ignore="VectorDrawableCompat" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -22,12 +22,12 @@
android:id="@+id/lv_reorder_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"></androidx.recyclerview.widget.RecyclerView>
android:scrollbars="none"/>
<RelativeLayout
android:id="@+id/undo_container"
android:visibility="gone"
android:background="@color/notif_black_3"
android:background="?colorPrimaryDark"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
@ -42,12 +42,11 @@
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_alignParentLeft="true" />
/>
<TextView
android:id="@+id/undo_action"
@ -58,14 +57,13 @@
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:textAllCaps="true"
android:text="@string/undo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_alignParentRight="true" />
/>
</RelativeLayout>
</RelativeLayout>

View File

@ -24,7 +24,6 @@
<TextView
android:id="@+id/set_text_size_value"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
@ -33,7 +32,7 @@
android:layout_gravity="center_vertical"
android:id="@+id/set_text_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"></SeekBar>
android:layout_height="wrap_content"/>
</LinearLayout>
<TextView
@ -53,7 +52,6 @@
<TextView
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:id="@+id/set_icon_size_value"
android:layout_gravity="center"
android:layout_width="50dp"
@ -63,6 +61,6 @@
android:layout_gravity="center_vertical"
android:id="@+id/set_icon_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"></SeekBar>
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>

View File

@ -34,11 +34,11 @@
<ImageView
android:id="@+id/close_conversation"
android:src="@drawable/ic_close"
android:tint="?attr/iconColor"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:contentDescription="@string/close" />
<ImageView
@ -48,7 +48,6 @@
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:contentDescription="@string/profile_picture" />
<TextView

View File

@ -39,11 +39,11 @@
<ImageView
android:id="@+id/toolbar_close"
android:src="@drawable/ic_close"
android:tint="?attr/iconColor"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:contentDescription="@string/close" />
<TextView

View File

@ -1262,4 +1262,5 @@
<string name="background_color_title">Background</string>
<string name="background_color">Change the background color for timelines</string>
<string name="pin_tag">Pin this tag</string>
<string name="logo_of_the_instance">Logo of the instance</string>
</resources>