swissonid / android-design-support-lib-sample Goto Github PK
View Code? Open in Web Editor NEWJust Sample how to use the android design support lib
License: Apache License 2.0
Just Sample how to use the android design support lib
License: Apache License 2.0
fragment_fexlible_space_with_image.xml
should be fragment_flexible_space_with_image.xml
Refactor > Rename in Android Studio should automatically change the one occurrence in FlexibleSpaceWithImageFragment:57
Hello can you please do the Flexible space with overlapping content example as shown i google material specs scrolling technics?
i found a bug, if scroll up and scroll down again title gone.
On some sections, the hamburger icon and the title are black, and other section are withe. Maybe it's a problem with the Style.
You are using "Theme.AppCompat.Light.NoActionBar". Should we use "dark"?
Hello Patrice,
first thank you for your great work, your logic help me a lot!
I like, that I can change the fragment with toolbar and all layouts together. I have only one question, how to to add to the toolbar "Menu items"?
I tried to import this project directly into Android Studio, but it had an issue because the project is in a subdirectory. Remove the first directory and it will import directly. Thanks.
Can't build project from console
$ ./gradlew build
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
The reason is there is no gradle/wrapper/gradle-wrapper.jar
in repository. It should not be in .gitignore
.
Hello again Patrice,
after removing android:screenOrientation="portrait" from AndroidManifest, the app crashes after device rotation:
java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.swissonid.design_samples/ch.swissonid.design_lib_sample.DrawerActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
I found some infos (Source 1, Source 2), do you have some experience with this problem?
Hello again,
"Flexible space with image" example do not overlap the status bar. You know how to fix it?
Hi,
Tested the sample on a nexus 5. How to reproduce the crash:
Process: ch.swissonid.design_samples, PID: 5637
java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.swissonid.design_samples/ch.swissonid.design_lib_sample.DrawerActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1377)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1395)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:637)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:616)
at ch.swissonid.design_lib_sample.util.Navigator.replaceFragment(Navigator.java:102)
at ch.swissonid.design_lib_sample.util.Navigator.setRootFragment(Navigator.java:91)
at ch.swissonid.design_lib_sample.DrawerActivity.setNewRootFragment(DrawerActivity.java:69)
at ch.swissonid.design_lib_sample.DrawerActivity.onCreate(DrawerActivity.java:53)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke
Is it possible to somehow implement the standard appbar example when the status bar and the navigation bar are translucent? I have not been able to do it using the existing scrolling behaviours
It seems that for the 2 "flexible" examples, there is a huge amount of empty space at the bottom.
How come?
Will it still work fine without it?
I know this is not a issue. But would be great if you add another layout with any expandable listview or a normal listview. As the toolbat hide and reveal is not working.
i want to add googlemap fragment in your projet but it didn't work for me
:
SupportMapFragment mapfrag = (SupportMapFragment)getChildFragmentManager().findFragmentById(R.id.map);
.
it give me error null exception in this line.
i need help
hi all,
i run this STOCK app without any modification, on an android 4.4 mobile, but fails. LOGCAT shows:
Process: ch.swissonid.design_samples, PID: 18966 java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.swissonid.design_samples/ch.swissonid.design_lib_sample.DrawerActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.design.widget.NavigationView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2375) at android.app.ActivityThread.access$900(ActivityThread.java:164) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1268) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5377) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.design.widget.NavigationView at android.view.LayoutInflater.createView(LayoutInflater.java:626) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) at ch.swissonid.design_lib_sample.DrawerActivity.onCreate(DrawerActivity.java:41) at android.app.Activity.performCreate(Activity.java:5433) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2281) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2375) at android.app.ActivityThread.access$900(ActivityThread.java:164) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1268) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5377) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:600) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) at ch.swissonid.design_lib_sample.DrawerActivity.onCreate(DrawerActivity.java:41) at android.app.Activity.performCreate(Activity.java:5433) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2281) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2375) at android.app.ActivityThread.access$900(ActivityThread.java:164) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1268) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5377) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1 at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:464) at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6371) at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1225) at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:1062) at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:82) at android.view.LayoutInflater.rInflate(LayoutInflater.java:768) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.support.design.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:184) at android.support.design.widget.NavigationView.inflateHeaderView(NavigationView.java:227) at android.support.design.widget.NavigationView.<init>(NavigationView.java:152) at android.support.design.widget.NavigationView.<init>(NavigationView.java:88) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:600) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) at ch.swissonid.design_lib_sample.DrawerActivity.onCreate(DrawerActivity.java:41) at android.app.Activity.performCreate(Activity.java:5433) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2281) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2375) at android.app.ActivityThread.access$900(ActivityThread.java:164) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1268) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5377) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at dalvik.system.NativeStart.main(Native Method)
this app runs well on an android 5.0 mobile. but design lib is for android 2.1 and above?
any hints?
I see a shadow under the toolbar on Lollipop but there is no shadow under the toolbar on pre-Lollipop. Do you know how to fix that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.