bug fix, code cleanup, drawable fix, style fix

This commit is contained in:
nuclearfog 2022-10-20 20:19:07 +02:00
parent 3ffdfd96aa
commit a498ec369f
12 changed files with 23 additions and 28 deletions

View File

@ -1,5 +1,6 @@
package org.nuclearfog.twidda.backend.api.update;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
@ -125,15 +126,17 @@ public class ProfileUpdate {
}
/**
* initialize inputstreams of the image files
* initialize input streams of the image files
* streams must be closed calling {@link #close()}
*
* @return true if initialization finished without any error
*/
@SuppressLint("Recycle")
public boolean prepare(ContentResolver resolver) {
try {
for (int i = 0; i < imageUrls.length; i++) {
if (imageUrls[i] != null) {
InputStream profileImgStream = resolver.openInputStream(imageUrls[i]);
InputStream profileImgStream = resolver.openInputStream(imageUrls[i]);
if (profileImgStream != null && profileImgStream.available() > 0) {
this.imageStreams[i] = profileImgStream;
} else {

View File

@ -100,6 +100,8 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
private Toolbar toolbar;
private TabLayout tablayout;
private int mode;
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(AppStyles.setFontScale(newBase));
@ -120,7 +122,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
settings = GlobalSettings.getInstance(this);
int mode = getIntent().getIntExtra(KEY_USERDETAIL_MODE, 0);
mode = getIntent().getIntExtra(KEY_USERDETAIL_MODE, 0);
long id = getIntent().getLongExtra(KEY_USERDETAIL_ID, -1);
switch (mode) {
@ -178,7 +180,6 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
@Override
public boolean onCreateOptionsMenu(@NonNull Menu m) {
int mode = getIntent().getIntExtra(KEY_USERDETAIL_MODE, 0);
if (mode == USERLIST_EXCLUDED_USERS) {
getMenuInflater().inflate(R.menu.excludelist, m);
MenuItem search = m.findItem(R.id.menu_exclude_user);
@ -195,15 +196,18 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
@Override
public boolean onPrepareOptionsMenu(Menu m) {
SearchView searchView = (SearchView) m.findItem(R.id.menu_exclude_user).getActionView();
if (tablayout.getSelectedTabPosition() == 0) {
String hint = getString(R.string.menu_hint_mute_user);
searchView.setQueryHint(hint);
} else if (tablayout.getSelectedTabPosition() == 1) {
String hint = getString(R.string.menu_hint_block_user);
searchView.setQueryHint(hint);
if (mode == USERLIST_EXCLUDED_USERS) {
SearchView searchView = (SearchView) m.findItem(R.id.menu_exclude_user).getActionView();
if (tablayout.getSelectedTabPosition() == 0) {
String hint = getString(R.string.menu_hint_mute_user);
searchView.setQueryHint(hint);
} else if (tablayout.getSelectedTabPosition() == 1) {
String hint = getString(R.string.menu_hint_block_user);
searchView.setQueryHint(hint);
}
return super.onPrepareOptionsMenu(m);
}
return super.onPrepareOptionsMenu(m);
return false;
}

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="328dp"
android:height="328dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="328"
android:viewportHeight="328">
<path

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="328dp"
android:height="328dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="328"
android:viewportHeight="328">
<path

View File

@ -4,7 +4,6 @@
android:viewportWidth="12000"
android:width="120dp">
<group>
<clip-path android:pathData="M0,0h12000v4000h-12000z" />
<path
android:fillColor="#111111"
android:fillType="evenOdd"

View File

@ -4,7 +4,6 @@
android:viewportWidth="4000"
android:width="40dp">
<group>
<clip-path android:pathData="M0,0h4000v4000h-4000z" />
<path
android:fillColor="#111111"
android:fillType="evenOdd"

View File

@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/half_transparent"
tools:context=".ui.activities.ImageViewer">
<org.nuclearfog.zoomview.ZoomView

View File

@ -94,7 +94,6 @@
app:layout_constraintEnd_toEndOf="parent">
<ScrollView
android:id="@+id/metrics_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/half_transparent"
tools:context=".ui.activities.VideoViewer">
<VideoView

View File

@ -72,7 +72,6 @@
<!--dimens of item_tweet.xml-->
<dimen name="tweetitem_profile_size">36sp</dimen>
<dimen name="tweetitem_layout_padding">5dp</dimen>
<dimen name="tweetitem_layout_margin">5dp</dimen>
<dimen name="tweetitem_text_margin">5dp</dimen>
<dimen name="tweetitem_drawable_margin">5dp</dimen>
<dimen name="tweetitem_textsize_button">12sp</dimen>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFA500</color>
</resources>

View File

@ -12,8 +12,6 @@
<style name="Transparency" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackground">@android:color/transparent</item>
</style>
<style name="TransparencyDim" parent="Transparency">