android-ui

How do I create an Android material design UI widget?

只愿长相守 提交于 2019-12-19 02:49:22
问题 I did read new android material design guide but i am not able to find anything about how to create this UI widget(element). Apps like Gmail, S converter etc has updated their apps to support new material design. I have added screenshot of it. Here is the link to it. because of low points i can't put the picture. sorry about it Any suggestions on how shall i make it?? 回答1: You are talking about the Floating Action Button. Bottom line is: there is no native "FAB" widget (at least for now), it

Create shadow for dialog

China☆狼群 提交于 2019-12-18 17:13:13
问题 I want to create a shadow for my custom dialog is that possible ? GhazalActivity.public void viewShareMenu() { Dialog share=new Dialog(this,R.style.shareDialogStyle); share.setContentView(R.layout.share_popup_layout); LayoutParams params = share.getWindow().getAttributes(); params.y = this.getResources().getDimensionPixelSize(R.dimen.topbar_height); params.gravity=(Gravity.RIGHT|Gravity.TOP); share.getWindow().setAttributes(params); share.show(); } styles.xml : <style name="shareDialogStyle"

Android: How to build tabs like the ones show on Android UI Page

我怕爱的太早我们不能终老 提交于 2019-12-18 13:27:26
问题 So android goes out of its way to build this nice UI guide for everyone to use. But I don't see anywhere where it shows code examples of how to build these elements. The UI guidelines for tabs can be found here. http://developer.android.com/design/building-blocks/tabs.html. Does anyone know how to create tabs likes the this one? Any help would be appreciated, thanks. SOLUTION POSTED Ok, so here is what I ended up doing after probably wasting about 10 hours trying to make some good looking

ACTION_INSTALL_PACKAGE

我怕爱的太早我们不能终老 提交于 2019-12-18 12:30:10
问题 My app is trying to install an APK. Intent installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE); installIntent.setData(Uri.fromFile(new File(pathToApk))); installIntent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true); installIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true); installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ((Activity)context).startActivityForResult(installIntent, Constants.APP_INSTALL_REQUEST); In my Activity protected void onActivityResult(int requestCode, int

Vintage Thermometer component + SensorSimulator on the Android emulator

纵饮孤独 提交于 2019-12-18 05:22:25
问题 After I found this nice custom component that analogly (is this the right word?) displays the temperature read from the Android device's temperature sensor, I wanted to test it with the emulator to see how it works so I've found this Sensor Simulator and altered the component's source to work with it. I did manage it to work on en emulated device, however I've done a few lucky guesses and'd like to know what exactly I've done :-) Here are the changes in thermometer's code I had to make to get

Floating Toolbar with Appcompat

纵然是瞬间 提交于 2019-12-17 22:43:16
问题 How to create a floating toolbar like the following image as proposed in the material design guidelines and in the Google Map application. 回答1: I've worked with the Toolbar before and all the comments from CommonsWare are absolutely correct. The Toolbar widget (https://developer.android.com/reference/android/support/v7/widget/Toolbar.html) have absolutely nothing special or different than any other Viewgroup and does not behave differently than any other ViewGroup. Put it inside a FrameLayout

Styling the popup menu in Android 5.0

China☆狼群 提交于 2019-12-17 22:19:06
问题 I'm making my app ready for Android 5.0, I'm using the latest compatibility library, here is what my style looks like. <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> </style> <style name="AppThemeDark" parent="Theme.AppCompat"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> <

Android XML theme inheriting from two parent themes?

懵懂的女人 提交于 2019-12-17 22:14:22
问题 Android styles and themes always seem to make my head spin. I wanted to use the Holo UI across different versions of Android for my app. So I decided to extract the necessary resources by browsing the source. I came across the following in android-15\data\res\values\themes.xml and I'm confused as to what exactly is being 'inherited' and from where: <style name="Theme.Holo.Light" parent="Theme.Light"> ... ... </style> The Android API Guide says : If you want to inherit from styles that you've

Custom UI for Android Wear Notifications

a 夏天 提交于 2019-12-17 21:17:48
问题 Hii I want to create Custom UI for android wear notification, and not AW app. Please suggest if there are any libraries or anything available for this. 回答1: It is not available yet, most likely it will be in the future. EDIT: Future is now. You can do this by passing own custom Activity by setDisplayIntent() , code sample: public Notification buildNotification(Context context) { Intent displayIntent = new Intent(context, AnimatedNotificationDisplayActivity.class); displayIntent.putExtra

Android UI - Android horizontal scroll view

早过忘川 提交于 2019-12-17 20:35:06
问题 Are there any samples similar to this? Android horizontal scroll view... Or how can I go about this? 回答1: Try to have a look at these: Sample Sample2 回答2: Pseudo: <LinearLayout android:orientation="vertical"> <HorizontalScrollView> <LinearLayout android:orientation="horizontal"> <Image1 /> <Image2 /> <Image3 /> <Image4 /> <Image5 /> </LinearLayout> </HorizontalScrollView> <LinearLayout android:orientation="horizontal"> <Button1 android:layout_weight="1" /> <Button2 android:layout_weight="1" /