android-layout

Android custom dialog gives an error

試著忘記壹切 提交于 2020-01-16 14:21:35
问题 In my android app I have to popup a dialog on a button click event . But when I click on the button the app stops working. I load the pre designed layout into the dialog. I will post a code segment. Button login = (Button) findViewById(R.id.btn_login); login.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { final Dialog dialog = new Dialog(getApplication()); dialog.setContentView(R.layout.journey_details); dialog.setTitle("Android Custom Dialog Box"); Button

How to add time slot in recyclerview android

♀尐吖头ヾ 提交于 2020-01-16 11:42:14
问题 I have recyclerview a and all times will be displayed. I want to display slot type. should i use any library to code layout like that? or we can do in our xml itself. please someone suggest me activity_booking_calender.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:orientation="vertical"> <RelativeLayout android

How to add time slot in recyclerview android

╄→尐↘猪︶ㄣ 提交于 2020-01-16 11:41:49
问题 I have recyclerview a and all times will be displayed. I want to display slot type. should i use any library to code layout like that? or we can do in our xml itself. please someone suggest me activity_booking_calender.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:orientation="vertical"> <RelativeLayout android

onApplyWindowInsets called with strange top inset

↘锁芯ラ 提交于 2020-01-16 10:09:30
问题 I have an Android app which has the following settings in its theme: <item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> The top View in the hierarchy overrides onApplyWindowsInsets() . The implementation just logs the WindowInsets it was passed, then calls through to the superclass method, logs the result and returns it—nothing is

How can I make images disappear from a grid view on touch?

南楼画角 提交于 2020-01-16 08:44:10
问题 I have a grid view with various image views within it, and I want these images to disappear when touched. How can I do this? How can I implement a touch listener for these grid view images? 回答1: The ImageViews all are types of views and the layouts are ViewGroups. Any of these you can set the visibility to gone or removed. So really you just neeed to implement onTouchListener event handler and then set visibility on the ImageViews. So you might want to consider setting a whole layout to

Pick multiple images form gallery in Redmi mobile

我是研究僧i 提交于 2020-01-16 08:36:14
问题 Below code is not working in Redmi 4A ...it's working maximum devices it not working only Redmi 4A..i donot know it's throwing Nullpointer exception Error: Exeception: something went wrongjava.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.ClipData.getItemCount()' on a null object reference if (Build.VERSION.SDK_INT < 19) { Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); galleryIntent

Hide Home button & disable right side options from system bar

∥☆過路亽.° 提交于 2020-01-16 05:19:13
问题 I have found non rooted apps which are capable of hide home button from bottom system bar of tabs (not all the devices but many of samsung tabs) & disabling (not hiding) right side wifi, settings entering panel in system bar (worked in all the testing devices). Good example is remote lock screen of Lookout premium app with BIND_DEVICE_ADMIN permission. This lock screen appears on top of the native android lock screen it has these features work in many devices. Is there a way to create an

ActionBar android with custom shape

女生的网名这么多〃 提交于 2020-01-16 00:46:16
问题 I have to develop an actionBar with a custom shape for an android app. The actionBar is a rectangle as always, but every option (icon) I add to the actionBar has to be bigger than the actionBar and with a circle shape. Any ideas how to implement that feature? I can't find how to solve this problem. Thanks. 回答1: I think you should remove the ActionBar completely and make your own custom view with desired content (as mentioned) and put that view on top of each activity. Customizing action bar

When changing textview, the text on a button below the textview moves down. Help!

空扰寡人 提交于 2020-01-15 18:51:32
问题 Pretty much I have a Textview that is acting as a display for asterisks when a user clicks a pin pad of Buttons I made. The buttons have their text centered, but it seems when I append something to the Textview text property the number 2 pin's layout changes to center at the bottom instead of the dead center. This is part part of the xml: <!-- PIN text --> <TableLayout> <TableRow android:id="@+id/btn_row1" android:gravity="center" android:layout_marginTop="6dip"> <!-- password text-->

When changing textview, the text on a button below the textview moves down. Help!

若如初见. 提交于 2020-01-15 18:50:49
问题 Pretty much I have a Textview that is acting as a display for asterisks when a user clicks a pin pad of Buttons I made. The buttons have their text centered, but it seems when I append something to the Textview text property the number 2 pin's layout changes to center at the bottom instead of the dead center. This is part part of the xml: <!-- PIN text --> <TableLayout> <TableRow android:id="@+id/btn_row1" android:gravity="center" android:layout_marginTop="6dip"> <!-- password text-->