mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
ViewerMainActivityからContainerを呼び出すように
This commit is contained in:
parent
92167656fc
commit
314214f734
|
@ -30,6 +30,7 @@ public class ViewerMainActivity extends AppCompatActivity {
|
||||||
private static final String TAG = "ViewerMainActivity";
|
private static final String TAG = "ViewerMainActivity";
|
||||||
String documentId;
|
String documentId;
|
||||||
String documentName;
|
String documentName;
|
||||||
|
boolean hasCombined = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -49,6 +50,7 @@ public class ViewerMainActivity extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
documentId = intent.getStringExtra("documentId");
|
documentId = intent.getStringExtra("documentId");
|
||||||
documentName = intent.getStringExtra("documentName");
|
documentName = intent.getStringExtra("documentName");
|
||||||
|
hasCombined = intent.getBooleanExtra("hasCombined", false);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.error(TAG, "Failed to get documentId from intent");
|
logger.error(TAG, "Failed to get documentId from intent");
|
||||||
|
@ -58,9 +60,18 @@ public class ViewerMainActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Navigation
|
// Navigation
|
||||||
|
// getSupportFragmentManager().beginTransaction()
|
||||||
|
// .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName))
|
||||||
|
// .commit();
|
||||||
|
if (hasCombined) {
|
||||||
getSupportFragmentManager().beginTransaction()
|
getSupportFragmentManager().beginTransaction()
|
||||||
.replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName))
|
.replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(documentId, documentName, hasCombined))
|
||||||
.commit();
|
.commit();
|
||||||
|
} else {
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(documentId, documentName))
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user