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
Branches
Tags
No related merge requests found
......@@ -128,6 +128,18 @@ public class MainActivity extends BoundActivity {
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) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.content_host, fragment);
......@@ -206,24 +218,23 @@ public class MainActivity extends BoundActivity {
Client client = context.client();
assertNotNull(client);
drawerLeft.removeAllItems();
status.bufferViewConfigId = bufferViewConfigId;
accountHeader.setActiveProfile(bufferViewConfigId, false);
drawerLeft.removeAllItems();
if (currentConfig != null)
currentConfig.remove();
currentConfig = null;
if (bufferViewConfigId != -1) {
QBufferViewManager bufferViewManager = client.bufferViewManager();
assertNotNull(bufferViewManager);
if (bufferViewConfigId != -1 && bufferViewManager != null) {
QBufferViewConfig viewConfig = bufferViewManager.bufferViewConfig(bufferViewConfigId);
assertNotNull(viewConfig);
if (viewConfig != null) {
currentConfig = new BufferViewConfigItem(drawerLeft, viewConfig, context);
}
}
}
private void updateBufferViewConfigs() {
assertNotNull(context.client().bufferViewManager());
......@@ -246,6 +257,12 @@ public class MainActivity extends BoundActivity {
super.onConnectToThread(thread);
if (thread == null)
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() {
......
......@@ -27,4 +27,6 @@ import de.kuschku.util.instancestateutil.Store;
public class Status extends Storable {
@Store
public int bufferViewConfigId = -1;
@Store
public int bufferId = -1;
}
......@@ -20,60 +20,49 @@
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ScrollView
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_gravity="bottom">
android:layout_height="wrap_content"
android:background="@color/md_light_background">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="">
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:padding="32dp"
android:orientation="vertical">
android:background="?attr/colorPrimary"
android:orientation="vertical"
android:padding="32dp">
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
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" />
android:textColor="@android:color/white"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView 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" />
android:textColor="@android:color/white"
android:textSize="16sp" />
</LinearLayout>
<android.support.v7.widget.CardView
<FrameLayout
android:id="@+id/content_host"
android:minHeight="240dp"
android:background="@color/md_light_background"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
</FrameLayout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment