android-layout

How I can clipping vertical line in a CardView?

牧云@^-^@ 提交于 2020-06-29 04:01:25
问题 I want clipping vertical line view in radius CardView like this pic: <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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="match_parent" android:orientation="vertical"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="140dp" android:layout_margin="20dp" app:cardCornerRadius="40dp">

Android studio 3.6.1, Layout not opening in an editor. Studio not showing the XML editor only shows the design part of layout? [duplicate]

六眼飞鱼酱① 提交于 2020-06-28 06:52:12
问题 This question already has answers here : Where is Android Studio layout preview? (22 answers) Closed 3 months ago . When i opened studio( Android studio 3.6.1 ) today. The layouts are not opening in an XML editor its not showing the XML editor but only the design part . Screenshot below I tried invalidate cache and restart, clean project, build project, sync gradle files , restarted my system nothing works. What is causing this odd behaviour ? 回答1: Click on button which is top right corner.

Multiple line TextView getLineForVertical returning wrong line order in Android

泪湿孤枕 提交于 2020-06-26 12:09:25
问题 The TextViews in a RecyclerView and, running following code when the Recyclerview onDown event happen: @Override public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) { int action = e.getAction() & MotionEvent.ACTION_MASK; TextView childTextView = (TextView) rv.findChildViewUnder(e.getX(), e.getY()); if(action == MotionEvent.ACTION_DOWN) { // y-coordinate of clicked point. int y = (int) e.getY() - childTextView.getTotalPaddingTop(); // line order of clicked

Multiple line TextView getLineForVertical returning wrong line order in Android

a 夏天 提交于 2020-06-26 12:08:14
问题 The TextViews in a RecyclerView and, running following code when the Recyclerview onDown event happen: @Override public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) { int action = e.getAction() & MotionEvent.ACTION_MASK; TextView childTextView = (TextView) rv.findChildViewUnder(e.getX(), e.getY()); if(action == MotionEvent.ACTION_DOWN) { // y-coordinate of clicked point. int y = (int) e.getY() - childTextView.getTotalPaddingTop(); // line order of clicked

Align Checkbox to center of the ListView item

落爺英雄遲暮 提交于 2020-06-26 07:34:32
问题 The following layout is used in my app to show cliplists. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/ClipNo" android:layout_width="0dp" android:layout_height="wrap_content" android:text="Clip No" android:textSize="20sp" android:gravity="center" android:layout_weight="1"/> <TextView android:id=

How can I make make a border for a clicked imagebutton in Android?

旧城冷巷雨未停 提交于 2020-06-25 18:09:24
问题 I am using Imagebuttons to show some icons in my android project. <ImageButton android:id="@+id/button_one" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:padding="20dp" android:contentDescription="@string/button_one" android:background="@android:color/transparent" android:src="@drawable/button_one" /> I would like, when the button is in pressed state, there to be a white border with

Android drawable-hdpi-night folder

风流意气都作罢 提交于 2020-06-25 08:58:27
问题 Please help, I am playing with small example of day-night mode in Android. So far so good. I have 2 images (of multiple size) that I am displaying depending on the phone mode (day/night), unfortunately I can't get it how, to name the folders that contain the images (in different resolution) in order to have a separate distinction. For the proper moment, the picture below contains the last try: and the error: Also I would like to have this structure into separate landscape/portrait folders us

Font for CollapsingToolbarLayout

被刻印的时光 ゝ 提交于 2020-06-25 07:31:35
问题 Is there a way to set the font for a CollapsingToolbarLayout ? I'm using Calligraphy but my default font is not applied. I think the problem is the CollapsingTextHelper class is using Canvas.drawText() instead of a TextView . How can I change the default font that is used for Canvas.drawText() ? 回答1: Since one of the latest API updates, the Support Design Package has been updated and now it's possible to set the font of the collapsing title text. Use setCollapsedTitleTypeFace(Typeface

Font for CollapsingToolbarLayout

此生再无相见时 提交于 2020-06-25 07:31:06
问题 Is there a way to set the font for a CollapsingToolbarLayout ? I'm using Calligraphy but my default font is not applied. I think the problem is the CollapsingTextHelper class is using Canvas.drawText() instead of a TextView . How can I change the default font that is used for Canvas.drawText() ? 回答1: Since one of the latest API updates, the Support Design Package has been updated and now it's possible to set the font of the collapsing title text. Use setCollapsedTitleTypeFace(Typeface

Android floating action button hidden behind of bottom navigation bar

南楼画角 提交于 2020-06-25 02:10:54
问题 New to android programming & struggling with right now. I'm using android studio's default "Navigation Drawer Activity". On top of that, I've added a Bottom Bar from https://github.com/roughike/BottomBar . But, after adding that my FAB has hidden behind the Bottom Bar. Here is the Scrrenshot - I know it's some kind of style issue. I tried to give bottomMargin for FAB. But, it's not working. Here is my code - app_bar_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design