android-layout

how to trigger proper Longclick event on listview

依然范特西╮ 提交于 2020-01-07 01:18:54
问题 i have to show Android Contextual action mode on long press of list view but when we long press then some multiple event trigger and Contextual menu hide so is there way to handle this problems. i also try return true on onLongClick() but its not working thanks in advance for your help 回答1: After search on stackoverflow i found my answer using this question implement GestureDetector on my listview an here is my code set GestureDetector on listview final GestureDetector gestureDetector = new

Incorrect background image being shown by XML Layout

╄→尐↘猪︶ㄣ 提交于 2020-01-06 23:50:44
问题 I created an XML with a relativelayout that has a webview and a relativelayout inside it. What I did is that I load my app on the webview and the app logo below it using the relativeLayout1. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/urlContainer" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <WebView android:id="@+id/webView" android:layout_width

How can I theme my action bar to match this image?

孤街浪徒 提交于 2020-01-06 21:06:46
问题 I'm working on an app's UI and I want to get the action bar to look like this: This is what it looks like right now: This is my styles.xml <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/sunshine_blue</item> <item name="colorPrimaryDark">@color/sunshine_dark_blue</item> </style> <!-- Main activity theme --> <style name="ForecastTheme" parent="AppTheme"> <item name="actionBarStyle">@style

Actionbar will not align correctly (RelativeLayout)

拈花ヽ惹草 提交于 2020-01-06 20:25:22
问题 I am trying to design my actionbar to have the textview in the dead center of the actionbar , and an imageview on the far right of the actionbar , but I just cannot get the image to align all the way right. The image will push my textview left and will leave a lot of space to the right of the imageview no matter what different attributes I change. Here is the action_bar custom XML layout which is inflated in my activity. [![ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android

Actionbar will not align correctly (RelativeLayout)

风流意气都作罢 提交于 2020-01-06 20:25:18
问题 I am trying to design my actionbar to have the textview in the dead center of the actionbar , and an imageview on the far right of the actionbar , but I just cannot get the image to align all the way right. The image will push my textview left and will leave a lot of space to the right of the imageview no matter what different attributes I change. Here is the action_bar custom XML layout which is inflated in my activity. [![ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android

How to change color of multiple choice to show correct answer

早过忘川 提交于 2020-01-06 20:12:45
问题 Im doing a multiple choice apps with 4 choices. How to prompt the user of the correct answer if he pressed the incorrect answer (at the same time).Here is a sample of the code. //Question/Answer options listener optionOne.setOnClickListener(this); //On First Option selection optionTwo.setOnClickListener(this); //On Second Option selection optionThree.setOnClickListener(this); //On Third Option selection optionFour.setOnClickListener(this); //On Forth Option selection skip.setOnClickListener

Toolbar not scrolling when using collapsing toolbar effect

杀马特。学长 韩版系。学妹 提交于 2020-01-06 19:35:10
问题 I am using below layout to use collapsing toolbar effect but not able to expand toolbar.I want to expand the toolbar as given here for collapsing toolbar effect. https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinatorLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=

Toolbar isn't in the center of the AppBarLayout

流过昼夜 提交于 2020-01-06 18:52:28
问题 I used this example to build a layout with two NavigationViews: http://v4all123.blogspot.de/2016/03/simple-example-of-navigation-view-on.html It works fine. But also in the demo on this site you can see, that the Toolbar isn't 100% in the middle. The left button has more space to the left than the right button to the right border. Take a look to the screenshot from Android Studio. I've tried to center each view but the only way to get the same space left and right is to add a padding to the

How to store image in app internal memory, after selecting from gallery and cropping through intent

ε祈祈猫儿з 提交于 2020-01-06 18:06:01
问题 In my app I am selecting an image from gallery, than I cropped that image, than store it in external storage. But if sd-card not available than problem occurs. So here I am asking you how to store image in application internal storage. Here is my code for external storage. Override public void onClick(View v) { int outputX = 400; int outputY = 400; int aspectX = 1; int aspectY = 1; Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null); intent.setType("image/*"); intent.putExtra("crop",

Customizing SeekBar Style - transparency and size issue

喜夏-厌秋 提交于 2020-01-06 18:03:16
问题 This question is a follow-up from this. After following the suggestions in the answer, my SeekBar definition is: <SeekBar android:id="@id/seek_bar_player" android:layout_width="match_parent" android:layout_height="12dp" android:layout_above="@id/player_container" android:layout_centerVertical="true" android:layout_marginBottom="-4.2dp" android:maxHeight="4dp" android:minHeight="4dp" android:padding="0dp" android:paddingEnd="10dp" android:paddingLeft="10dp" android:paddingRight="10dp" android