android-ui

Change homeAsUpIndicator dynamically

北城余情 提交于 2019-12-12 00:28:33
问题 I build an app with four tabs and, as a consequence, four fragments. In the first fragment, I have a sliding menu and I throw with a custom icon in the actionbar. The problem is that in the others fragments, I want to stablish other custom icon to return to the first fragment but I don't know what to do... This is my styles.xml with my custom icon for the sliding menu: <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:homeAsUpIndicator">@drawable

How to embed app drawer / app launcher in Android Application

烂漫一生 提交于 2019-12-11 21:53:47
问题 I'd like to embed the app drawer within an activity/layout in my android app. Has anyone seen an example of how this can be done? I did a StackOverflow search and I wasn't able to find anything useful... https://stackoverflow.com/search?q=app+drawer 回答1: Download DevApps Direct on your device. All the samples DevApps showcases are open source. It has an example called "Sliding up Panel", with its code here. But note that you'll also need to merge the code for this gridview example if you want

Android - Trying to gradually fill a circle bottom to top

无人久伴 提交于 2019-12-11 17:33:11
问题 I'm trying to fill a round circle (transparent other than the outline of the circle) in an ImageView. I have the code working: public void setPercentage(int p) { if (this.percentage != p ) { this.percentage = p; this.invalidate(); } } @Override public void onDraw(Canvas canvas) { Canvas tempCanvas; Paint paint; Bitmap bmCircle = null; if (this.getWidth() == 0 || this.getHeight() == 0 ) return ; // nothing to do mergedLayersBitmap = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap

How to start splash activity(very first activity) from left to right animation effect in android

点点圈 提交于 2019-12-11 13:43:51
问题 I have made an activity in android,I want is when i start the app the very first activity in my app should come from left and slide to right animation effect.but i have no idea about how to implement it,So can anyone help me or give me some trick so that i can solve it out.I have animation XML ready with my project. Thank you in advance my code: package com.esp.Estorec.ui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import

How can I add an Image in my custom shape xml

不想你离开。 提交于 2019-12-11 12:59:54
问题 I'm writing an XML selector <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/image_state2" android:state_pressed="true"/> <item android:drawable="@drawable/image_state1"/> </selector> I just want state1 to be transparent.So that the image to be seen as - is state1 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="270" android

How to set same font family to entire android application

会有一股神秘感。 提交于 2019-12-11 09:37:07
问题 Hello I want to set same font family to entire Android application. I have seen this Is it possible to set a custom font for entire of application? but this all doing using code. I want to set in Theme such that it will work in all. It should convert the font family of ActionBar text also. Any way to do this ? styles.xml <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name=

How to load menu inside a list view when a list item is long pressed

ε祈祈猫儿з 提交于 2019-12-11 06:09:42
问题 I'm trying to mimic an action in the Twitter android app. When you long press/swipe a tweet (list item) it looks like this This makes it easy for the user to take actions on the list item without leaving the screen. How can I do something similar in my app? For now I've added a context menu which looks like this (notice that it fades out rest of the app). I achieved this by registerForContextMenu(listView) Currently, my list is like this: ListAdapter adapter = new SimpleAdapter( MainActivity

Dynamically change the name of the resource file to be used?

我的梦境 提交于 2019-12-11 05:31:04
问题 It is possible to do something like: if (colorScheme == 1) button.setBackgroundResource(R.drawable.button + "_1") in order to use R.drawable.button_1 as the resource for this button in color scheme 1, if there are files named button_1.png, button_2.png, button_3.png in drawable folder. (dynamically use different resource file for the same UI element based on the color scheme being used?) Thanks, 回答1: I've done something simular using getIdentifier(): int resId = context.getResources()

Notification drawer in google plus app

我是研究僧i 提交于 2019-12-11 02:48:40
问题 I want to implement Right side notification drawer in my android app like the google plus app. I tried doing it with navigation drawer but the action bar drawer toggle takes drawer layout as input instead of a particular view and thus reacts to both left and right drawer unlike g+ app. Sliding drawer could be another option but that has been deprecated in API level 17. What can i use to implement that functionality in my app? here is an image of what I want: http://i.stack.imgur.com/qkH30.png

Modifying style does not work well

跟風遠走 提交于 2019-12-11 02:39:59
问题 I'm changing the UI of my app to green colors. In the ActionBar, I use a ShareActionProvider to share data to other users, but this menu item doesn't get the same color as the other menu items. However, its dropdown listview has the correct colors. I'm running my app in GingerBread, so when I press menu key, a menu item appears but it also has the wrong colors. I have used Android Action Bar Style Generator, but there is something I'm missing. This is my code in /res/values: <resources xmlns