android-layout

Android: Draw shape with skewed corner

徘徊边缘 提交于 2021-02-20 19:07:51
问题 I want to use a background for my buttons. But when I use a png it slows down the app. Therefore I want to use a xml shape but I do not know how to make the corner cut (like on the picture). By now I have the following shape which is just a rectangle: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/blue_semi_transparent"/> <padding android:bottom="10dp" android:right="10dp" android:top="10dp" android:left=

Input Error in android

↘锁芯ラ 提交于 2021-02-19 03:48:26
问题 I developed an application in android. Its input fields are working fine e.g. username and password inputs (this will call the services and get a xml response) in 2.2, 2.3 but it does not work in 4.0, 4.1. xml EditText android:id="@+id/email" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="4" android:imeOptions="actionNext" android:singleLine="true" android:text="" in error log. Url is not found (in catch exception..) edit android 4.1 sdk and

Different corner radius values for a MaterialCardView

£可爱£侵袭症+ 提交于 2021-02-18 22:27:08
问题 Is is possible to have different values for each corner radius of a MaterialCardView? And if so how? I tried something like the code below but it doesn't seem to have any effect float radius = getContext().getResources().getDimension(R.dimen.default_corner_radius); ShapePathModel leftShapePathModel = new ShapePathModel(); leftShapePathModel.setTopLeftCorner(new RoundedCornerTreatment(radius)); leftShapePathModel.setTopRightCorner(new RoundedCornerTreatment(radius)); MaterialShapeDrawable bg =

Android RelativeLayout and height of wrap_content?

☆樱花仙子☆ 提交于 2021-02-18 03:19:06
问题 I am trying to make a selection ListActivity, similar to the one used to add shortcuts to the launcher screens. I have rolled my own header and footers, which I would like to be "sticky" at the top and bottom of the view when on screen. In order to do this, I am using a RelativeLayout with the header set to dock to top, footer set to dock to bottom, and the list set to go below the header and above the footer. In terms of the overall layout of the activity, this is rendering as I would expect

Android RelativeLayout and height of wrap_content?

筅森魡賤 提交于 2021-02-18 03:18:13
问题 I am trying to make a selection ListActivity, similar to the one used to add shortcuts to the launcher screens. I have rolled my own header and footers, which I would like to be "sticky" at the top and bottom of the view when on screen. In order to do this, I am using a RelativeLayout with the header set to dock to top, footer set to dock to bottom, and the list set to go below the header and above the footer. In terms of the overall layout of the activity, this is rendering as I would expect

Android RelativeLayout and height of wrap_content?

て烟熏妆下的殇ゞ 提交于 2021-02-18 03:17:15
问题 I am trying to make a selection ListActivity, similar to the one used to add shortcuts to the launcher screens. I have rolled my own header and footers, which I would like to be "sticky" at the top and bottom of the view when on screen. In order to do this, I am using a RelativeLayout with the header set to dock to top, footer set to dock to bottom, and the list set to go below the header and above the footer. In terms of the overall layout of the activity, this is rendering as I would expect

Crash when closing soft keyboard while using native activity

天涯浪子 提交于 2021-02-18 02:29:00
问题 We are developing an indie game for android and would like the user to choose his nickname. We have chosen to use the Native Activity that is provided by the NDK as that seemed to be the easiest way to go. The first problem we've encountered with the keyboard was that the function ANativeActivity_showSoftInput() seems to do nothing at all (as described e.g. here), so we bring up the keyboard using JNI calls to function: static void showKeyboard(Activity activity) { String s = Context.INPUT

Crash when closing soft keyboard while using native activity

旧巷老猫 提交于 2021-02-18 02:25:14
问题 We are developing an indie game for android and would like the user to choose his nickname. We have chosen to use the Native Activity that is provided by the NDK as that seemed to be the easiest way to go. The first problem we've encountered with the keyboard was that the function ANativeActivity_showSoftInput() seems to do nothing at all (as described e.g. here), so we bring up the keyboard using JNI calls to function: static void showKeyboard(Activity activity) { String s = Context.INPUT

Any faster way to dump UI hierarchy?

别来无恙 提交于 2021-02-17 22:23:08
问题 Right now I'm using uiautomator do dump the UI like this: adb shell uiautomator dump And it works fine except that it takes around 3 seconds to perform it. So I wonder if there is a faster way to do it? Like creating a service that dump the UI or will it take just as long? 回答1: Guess I should answer my own question as I found a better way to do it. I found this project that use uiautomator togheter with a light weight rpc server so you can send commands to the device: https://github.com

Android: How to swipe between activities (not fragments), master/detail best set-up

本小妞迷上赌 提交于 2021-02-17 21:00:14
问题 I'm working on an android app and I'm fairly new to all this, including mobile app development, so I have a few questions. Any help would be amazing! 1) Is it possible to swipe between entire activities (including action bar)? And I don't mean like viewPager swapping between fragments, I mean swapping the entire screen (like snapchat does on iOS). Is this possible at all? And if so, how can I do this? 2) What is the best way to implement a master/detail type layout? Like twitter for instance,