Performance Bugfix

This commit is contained in:
NudeDude 2018-03-27 22:32:38 +02:00
parent c272cecd87
commit b7c6b89e31
3 changed files with 22 additions and 19 deletions

View File

@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity implements
private String currentTab = "timeline";
private int background, font_color, highlight;
private long homeId = 0L;
private boolean settingChanged = false;
private final int REQCODE = 666;
@Override
@ -125,6 +126,7 @@ public class MainActivity extends AppCompatActivity implements
startActivity(intent);
return true;
case R.id.action_settings:
settingChanged = true;
intent = new Intent(this, AppSettings.class);
startActivity(intent);
return true;
@ -134,9 +136,14 @@ public class MainActivity extends AppCompatActivity implements
}
@Override
protected void onResume(){
protected void onResume() {
super.onResume();
setTabContent();
if(settingChanged) {
timelineList.setAdapter(null);
trendList.setAdapter(null);
mentionList.setAdapter(null);
setTabContent();
}
}
@Override

View File

@ -1,20 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="horizontal"
android:padding="4dp">
<TextView
android:id="@+id/trendpos"
android:layout_width="32dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="5dp" />
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:gravity="center_vertical|end"
android:textAlignment="gravity" />
<TextView
android:id="@+id/trendname"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_weight="12"
android:singleLine="true"
android:textSize="20sp" />

View File

@ -3,15 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:padding="5dp">
<LinearLayout
android:id="@+id/user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<ImageView
@ -54,7 +52,6 @@
android:id="@+id/time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_weight="1"
android:gravity="end"
android:textAlignment="gravity"
@ -76,27 +73,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp" />
<LinearLayout
android:id="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:addStatesFromChildren="false"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/retweeter"
android:layout_width="wrap_content"
android:layout_width="150dp"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="6"
android:singleLine="true"
android:textSize="12sp" />