Skip to content
Snippets Groups Projects
Commit bc52c5a8 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed issues with the setup dialog

parent 85c1c280
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,18 @@ public class MainActivity extends BoundActivity { ...@@ -128,6 +128,18 @@ public class MainActivity extends BoundActivity {
manager = new AccountManager(this); manager = new AccountManager(this);
} }
@Override
protected void onPause() {
if (context.client() != null)
context.client().backlogManager().open(-1);
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
private void replaceFragment(Fragment fragment) { private void replaceFragment(Fragment fragment) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.content_host, fragment); transaction.replace(R.id.content_host, fragment);
...@@ -206,22 +218,21 @@ public class MainActivity extends BoundActivity { ...@@ -206,22 +218,21 @@ public class MainActivity extends BoundActivity {
Client client = context.client(); Client client = context.client();
assertNotNull(client); assertNotNull(client);
drawerLeft.removeAllItems();
status.bufferViewConfigId = bufferViewConfigId; status.bufferViewConfigId = bufferViewConfigId;
accountHeader.setActiveProfile(bufferViewConfigId, false); accountHeader.setActiveProfile(bufferViewConfigId, false);
drawerLeft.removeAllItems();
if (currentConfig != null) if (currentConfig != null)
currentConfig.remove(); currentConfig.remove();
currentConfig = null; currentConfig = null;
if (bufferViewConfigId != -1) { QBufferViewManager bufferViewManager = client.bufferViewManager();
QBufferViewManager bufferViewManager = client.bufferViewManager(); if (bufferViewConfigId != -1 && bufferViewManager != null) {
assertNotNull(bufferViewManager);
QBufferViewConfig viewConfig = bufferViewManager.bufferViewConfig(bufferViewConfigId); QBufferViewConfig viewConfig = bufferViewManager.bufferViewConfig(bufferViewConfigId);
assertNotNull(viewConfig); if (viewConfig != null) {
currentConfig = new BufferViewConfigItem(drawerLeft, viewConfig, context);
currentConfig = new BufferViewConfigItem(drawerLeft, viewConfig, context); }
} }
} }
...@@ -246,6 +257,12 @@ public class MainActivity extends BoundActivity { ...@@ -246,6 +257,12 @@ public class MainActivity extends BoundActivity {
super.onConnectToThread(thread); super.onConnectToThread(thread);
if (thread == null) if (thread == null)
connectToServer(manager.account(context.settings().lastAccount.get())); connectToServer(manager.account(context.settings().lastAccount.get()));
else {
if (context.client() != null) {
context.client().backlogManager().open(status.bufferId);
accountHeader.setActiveProfile(status.bufferViewConfigId, true);
}
}
} }
public void displayFilterDialog() { public void displayFilterDialog() {
......
...@@ -27,4 +27,6 @@ import de.kuschku.util.instancestateutil.Store; ...@@ -27,4 +27,6 @@ import de.kuschku.util.instancestateutil.Store;
public class Status extends Storable { public class Status extends Storable {
@Store @Store
public int bufferViewConfigId = -1; public int bufferViewConfigId = -1;
@Store
public int bufferId = -1;
} }
...@@ -20,60 +20,49 @@ ...@@ -20,60 +20,49 @@
~ with this program. If not, see <http://www.gnu.org/licenses/>. ~ with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<FrameLayout <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_width="match_parent"> android:layout_height="wrap_content"
android:background="@color/md_light_background">
<ScrollView <LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_gravity="bottom"> android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity=""> android:background="?attr/colorPrimary"
android:orientation="vertical"
android:padding="32dp">
<LinearLayout <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="96dp" android:layout_marginBottom="32dp"
android:padding="32dp" android:text="@string/slideAccountcoreTitle"
android:orientation="vertical"> android:textColor="@android:color/white"
android:textSize="28sp"
<TextView android:textStyle="bold" />
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="28sp"
android:layout_marginBottom="32dp"
android:text="@string/slideAccountcoreTitle"
android:id="@+id/title" />
<TextView <TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/slideAccountcoreDescription"
android:id="@+id/description" />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/content_host"
android:minHeight="240dp"
android:background="@color/md_light_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:text="@string/slideAccountcoreDescription"
android:textColor="@android:color/white"
android:textSize="16sp" />
</LinearLayout> </LinearLayout>
</ScrollView> <FrameLayout
android:id="@+id/content_host"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout> </ScrollView>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment