android-ui

Transitioning between activities without moving actionbar

北城以北 提交于 2019-12-07 23:33:27
Does anyone know how to transition between activities without animating the actionbar like in the Gmail app? It is not a transition between Activities , but between Fragments . http://developer.android.com/guide/components/fragments.html Fragments were introduced in 3.0, but there is a backport library in the android SDK. You can use them from and above API level 4. Try with this: Intent myIntent = new Intent(context, MyActivity.class); myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); context.startActivity(myIntent); 来源: https://stackoverflow.com/questions/11904758/transitioning-between

Android gridview skip cell

时光怂恿深爱的人放手 提交于 2019-12-07 13:09:55
问题 How can I skip some cells in grid view. I mean I have next source: public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { ImageView

How to use two different font sizes for button text in Android?

拈花ヽ惹草 提交于 2019-12-07 12:44:40
问题 How could I implement a button background for ImageButton or Button which contains 2 textview each using different font sizes ? I cant use static images as background and I need to achieve this either using xml or programmatically. This is a numeric keypad and it carries a numeric value and a set of alphabets each of which uses different font sizes and needs to be set as button text. Here are some of the suggestions that pop-up on my brain but seems to have limitations since I want to reuse

How to achieve Android UI like this image layout? About android:clipChildren

痴心易碎 提交于 2019-12-07 06:40:30
问题 What I want to achieve is like this layout: I have tried to use this code, to achieve like that image, but unfortunately, I failed. This is the snippet of my code: <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:clipChildren="false" > <RelativeLayout android:id="@+id/text_area_third" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/round_corner_background"

android:pitfalls of deleting ldpi/mdpi folders

南楼画角 提交于 2019-12-07 05:21:48
问题 I was wondering what are the pitfalls of deleting the ldpi/mdpi/hdpi folders on my android project? Can i just copy all the images in the drawable folder instead? I did see the following links about UI development for android http://developer.android.com/guide/practices/ui_guidelines/icon_design.html http://developer.android.com/guide/practices/screens_support.html thanks PS: I 'm referring to all the images that are being used, background,icons,menus etc... 回答1: If you want to, go for it.

Remove series indicator/plot legend AndroidPlot

喜夏-厌秋 提交于 2019-12-07 04:10:08
问题 I realise AndroidPlot has a forum but it isn't the most active so i'll chance my arm here... I'm trying to remove the series indicator or plot legend from my XY plot using the AndroidPlot library. I don't want to remove the series from the plot itself, just the legend. I've seen it done on AndroidPlot examples but with the limited documentation it's difficult to find methods to do the stuff like remove the legen 回答1: OK I have the following code to do this. This is not tested on the very

Get the position of the current image displayed in Gallery

社会主义新天地 提交于 2019-12-06 21:00:04
问题 in my application , i have a gallery of pictures, but i want to detect the position of the current image displayed , For example : when i launch my acvitivity, the position is 0, but when i scroll in my gallery,i want to get The position of the Current image displayed , i have tried OnFocusChanged , OnItemClicked , but that works only if i click on an item of my gallery Any ideas ! :( 回答1: gal.setOnItemSelectedListener(new OnItemSelectedListener(){ @Override public void onItemSelected

Android Service and AlertDialog Activity

岁酱吖の 提交于 2019-12-06 16:12:10
I'm trying to build a service which runs in the background and pops up an alert dialog even when you are not in the application screen currently. I'm using an alarm manager. My problem is that when my alert dialog activity pops up - it shows the application activity as background. In other words, I don't want the alert dialog to change the current background and after the user is clicking "OK" it will be back to the same state, and not to my application. How can I do that ? The easiest way would probably be to let the service pop up a new activity. Either you make the activity itself look like

Updating Activity UI from Intent Service?

社会主义新天地 提交于 2019-12-06 14:08:24
问题 I need to download some files (10-20 or depends on user) from service in my app. The problem is I am using IntentSevice and finding it hard to update activity UI. I know following ways to update UI Use handler and send messages from service to activity using Messenger like this. Send broadcast intents. Using first method would cause problem once activity is closed & re-opened and also I am not sure about its performance. Using second would definitely cause perfomance issues since I need to

Supporting multiple screens in android in single layout

ⅰ亾dé卋堺 提交于 2019-12-06 12:33:31
I have followed the following link so that my application can support different screen sizes: Supporting multiple screens in android That solution works perfectly. But my concern here is, when I have an android application having 8-9 screens, then it means that I will have 8-9 different .xml layout files. Now to support all screens by folder bifurcation , it means I have manage almost above fifty xml files for layouts and for a simple change in UI, I have to go to all the folders and implement that change in xml file. So can there be a better way , I mean such a layout that can just resize the