Last active
November 10, 2016 00:48
-
-
Save iandouglas/0d6daa197bc0062e3317b41f2a40eff3 to your computer and use it in GitHub Desktop.
Stuck on styling a taskstack toolbar on the launched activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| <application | |
| android:name=".MyApplication" | |
| android:allowBackup="true" | |
| android:icon="@mipmap/ic_launcher" | |
| android:label="@string/app_name" | |
| android:screenOrientation="portrait" | |
| android:supportsRtl="true" | |
| android:theme="@style/AppTheme"> | |
| <activity | |
| android:name=".activities.MainActivity" | |
| android:label="@string/app_name" | |
| android:screenOrientation="portrait" | |
| android:theme="@style/AppTheme.NoActionBar"> | |
| <intent-filter> | |
| <action android:name="android.intent.action.MAIN" /> | |
| <category android:name="android.intent.category.LAUNCHER" /> | |
| </intent-filter> | |
| </activity> | |
| <activity | |
| android:name=".activities.RegisterActivity" | |
| android:theme="@style/AppTheme" | |
| android:label="@string/menu_register" | |
| android:parentActivityName="io.getstream.example.activities.MainActivity" | |
| android:screenOrientation="portrait" | |
| android:windowSoftInputMode="stateHidden" /> | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml ...> | |
| <android.support.design.widget.CoordinatorLayout ... | |
| <android.support.design.widget.AppBarLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:theme="@style/AppTheme.AppBarOverlay"> | |
| <android.support.design.widget.AppBarLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:theme="@style/AppTheme.AppBarOverlay"> | |
| <android.support.v7.widget.Toolbar | |
| android:id="@+id/toolbar" | |
| android:layout_width="match_parent" | |
| android:layout_height="?attr/actionBarSize" | |
| app:popupTheme="@style/ToolbarPopupOverlay" <!-- is this even needed? --> | |
| android:theme="@style/ToolbarTheme" /> | |
| </android.support.design.widget.AppBarLayout> | |
| </android.support.design.widget.AppBarLayout> | |
| ... | |
| </android.support.design.widget.CoordinatorLayout> | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void launchActivity(String activity, Context context) { | |
| intent = null; | |
| int requestCode = 0; | |
| if (activity.equals("register")) { | |
| requestCode = CONST_ACTIVITY_REGISTER; | |
| intent = new Intent(context, RegisterActivity.class); | |
| } else { ... } | |
| if (intent != null) { | |
| TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this); | |
| taskStackBuilder.addParentStack(MainActivity.class); | |
| taskStackBuilder.addNextIntent(intent); | |
| PendingIntent pendingIntent = taskStackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT); | |
| NotificationCompat.Builder builder = new NotificationCompat.Builder(this); | |
| builder.setContentIntent(pendingIntent); | |
| startActivityForResult(intent, requestCode); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why are you using 2 AbbBarLayout anyway?