Alert dialog box Shifting left and right - java

Well I have achieved the rounded corner goal in alert dialog box but it has taken all the left and right side.
My question is like I want some space between left and right of the dialog box
Here is my code:Custom dialog
<?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="vertical"
android:background="#drawable/custom_dialog"
>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="SELECT PHOTO"
android:textSize="15dp"
android:paddingBottom="12dp"
android:paddingTop="12dp"
android:layout_marginLeft="20dp"></TextView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/hint_color"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="15dp"
android:id="#+id/Select_photo_from_Camera">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/camera_24dp"
android:layout_marginLeft="22dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Camera"
android:layout_marginLeft="10dp"
></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="600dp"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="#color/hint_color"></View>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="15dp"
android:paddingBottom="5dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_photo_library_black_24dp"
android:layout_marginLeft="22dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Gallery"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
</LinearLayout>
Code for :Custom_dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#color/white"></solid>
<corners
android:radius="5dp"
></corners>
<padding
android:top="6dp"
android:bottom="6dp"></padding>
</shape>
Here is the Output of my achievement:
https://i.stack.imgur.com/7G0Go.png

Create a inset and set as background, that may help
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="#drawable/your_background_image"
android:insetRight="25dip"
android:insetLeft="25dip" />
use
android:background="#drawable/inset_background"

Related

Layout below not working in android relative xml

I'm confused why android:layout_below is not working, I just need to put the button below the border line and I don't wanna use android:layout_marginTop="570dp because the android phone has different sizes, Is somebody know how can I arrange the layout of this? it helps me a lot thanks in advance.
This is what I want to achieve
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="100dp"
android:background="#drawable/selector_fieldset_background"
android:orientation="vertical"
android:id="#+id/linearl">
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#color/white"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Cash Card Scanner"
android:textSize="15dp"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<Button
android:id="#+id/button2"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SCAN"
android:layout_below="#+id/linearl"
/>
</RelativeLayout>
Drawable selector_fieldset_background.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#FFFFFF" />
<stroke
android:width="2dip"
android:color="#25000000" />
</shape>
Just try this, works for me:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="#drawable/selector_fieldset_background"
android:orientation="vertical"
android:id="#+id/linearl"
android:layout_above="#+id/button2"
>
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#color/white"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Cash Card Scanner"
android:textSize="15dp"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<Button
android:id="#+id/button2"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="90dp"
android:text="SCAN"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>

How to resize image inside circle in android studio?

I am working on an android project where i am trying to create an image like a star inside a circle
like this one
I have tried but i am unable to resize the star.
Every time i try to resize star android studio resize my whole image
this is my circle shape xml:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="#color/darkPurple"/>
<size
android:width="50dp"
android:height="50dp"/>
</shape>
this is my star xml:
<vector android:autoMirrored="true" android:height="1dp"
android:tint="#FFB404" android:viewportHeight="24"
android:viewportWidth="24" android:width="1dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
</vector>
This is my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:layout_gravity="center"
android:background="#drawable/circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_baseline_star_24"
>
</ImageView>
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Markets"
android:textColor="#color/white"
>
</TextView>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_gravity="center"
android:background="#drawable/circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_baseline_star_24"
>
</ImageView>
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Markets"
android:textColor="#color/white"
>
</TextView>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_gravity="center"
android:background="#drawable/circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_baseline_star_24"
>
</ImageView>
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Markets"
android:textColor="#color/white"
>
</TextView>
</LinearLayout>
</LinearLayout>
Please tell me how can i do this
I had the similar problem and I fixed it using below methods.
You can either add padding inside your ImageView
<ImageView
android:layout_gravity="center"
android:background="#drawable/circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_baseline_star_24"
android:padding="16dp"> <!-- Here is the change -->
or set scaleType attribute in ImageView to fit according to your need.
<ImageView
android:layout_gravity="center"
android:background="#drawable/circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_baseline_star_24"
android:scaleType="centerInside"> <!-- Here is the change -->

Fill the width in landscape mode with two imageviews

I have this recyclerview, and the background is made with imageviews. I have these two situations in portrait and landscape. How do I fill the white space there with a new imageview or something with the same color?
And this is my xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/home_imageview_superbackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true" />
<ImageView
android:id="#+id/home_imageview_background"
android:contentDescription="Background image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_alignParentEnd="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true">
<TextView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="casual"
android:paddingBottom="10dp"
android:paddingStart="5dp"
android:paddingTop="10dp"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="#android:color/white"
android:textSize="40sp" />
</RelativeLayout>
Tried several ways, but I'm just not able to make this work. #+id/home_imageview_superbackground this is the imageview I want to put on the left of each background imageview to fill that space in the landscape. Thank you for the help.
Please try this one
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/home_imageview_superbackground"
android:layout_width="match_parent"
android:src="#mipmap/ic_launcher"
android:scaleType="fitXY"
android:layout_height="wrap_content" />
<ImageView
android:id="#+id/home_imageview_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher"
android:scaleType="fitXY"
android:contentDescription="Background image" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true">
<TextView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="casual"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="#android:color/white"
android:textSize="40sp" />
</RelativeLayout>
</RelativeLayout>
You can also use android:scaleType="centerCrop".
Hope this will help you..If still you face problem please inform me...
<ImageView
android:layout_width="match_parent"
.... />
Also you can use scaleTypeattribute
First, the fill_parent is deprecated times ago, you should use match_parent instead. Then, you have also to use scaleType when you're working with ImagesView to define how the image looks on the screen. In your case, working with scaleType = "fitXY" solve your problem.
How your code should be :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content">
<ImageView
android:id="#+id/home_imageview_superbackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:layout_alignParentStart="true" />
<ImageView
android:id="#+id/home_imageview_background"
android:contentDescription="Background image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:layout_alignParentEnd="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true">
<TextView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="casual"
android:paddingBottom="10dp"
android:paddingStart="5dp"
android:paddingTop="10dp"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="#android:color/white"
android:textSize="40sp" />
</RelativeLayout>
Try this code
<?xml version="1.0" encoding="utf-8"?><?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/your_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher"
android:scaleType="fitEnd"
android:layout_alignParentStart="true"
android:background="#drawable/green_gradiant"
android:padding="10dp" />
<TextView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="casual"
android:paddingBottom="10dp"
android:paddingStart="5dp"
android:paddingTop="10dp"
android:text="Hello Three"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="#android:color/white"
android:textSize="40sp" />
</FrameLayout>
And create this drawable file
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="0"
android:startColor="#64FFDA"
android:centerColor="#4464FFDA"
android:endColor="#0064FFDA"/>
</shape>
</item>
</selector>

Java android frame layout

I want to do this :
I did this :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_aplication_settings"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e2e2e2"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.smok.maps.AplicationSettings">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<TextView
android:id="#+id/textSync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="#string/sync" />
<LinearLayout
android:id="#+id/line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textSync">
<TextView
android:id="#+id/actual"
android:layout_width="wrap_content"
android:textColor="#000000"
android:layout_height="wrap_content"
android:text="#string/actual" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/count" />
<TextView
android:id="#+id/actual2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="min" />
</LinearLayout>
<LinearLayout
android:id="#+id/lin2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/line1"
android:orientation="horizontal">
<CheckBox
android:id="#+id/checkBox1"
android:layout_width="50dp"
android:layout_height="50dp"
android:button="#xml/setting_checkbox"
android:focusable="false"
android:gravity="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/point" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="#000000"
android:text="#string/show_choose_point" />
</LinearLayout>
<LinearLayout
android:id="#+id/lin3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/lin2"
android:orientation="horizontal">
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="50dp"
android:layout_height="50dp"
android:button="#xml/setting_checkbox"
android:focusable="false"
android:gravity="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/sync" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#000000"
android:gravity="center"
android:text="#string/sync_request" />
</LinearLayout>
<LinearLayout
android:id="#+id/lin4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/lin3"
android:orientation="horizontal">
<CheckBox
android:id="#+id/checkBox3"
android:layout_width="50dp"
android:layout_height="50dp"
android:button="#xml/setting_checkbox"
android:focusable="false"
android:gravity="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/show_chooce" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#000000"
android:gravity="center"
android:text="#string/show_choosen_points" />
</LinearLayout>
<LinearLayout
android:id="#+id/lin5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/lin4"
android:orientation="horizontal">
<CheckBox
android:id="#+id/checkBox4"
android:layout_width="50dp"
android:layout_height="50dp"
android:button="#xml/setting_checkbox"
android:focusable="false"
android:gravity="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/position2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="#000000"
android:text="#string/current_location" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal">
<Button
android:id="#+id/back_bt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#ffffff"
android:background="#xml/roundedbutton"
android:text="#string/back" />
<View
android:layout_width="0dp"
android:layout_weight="0.1"
android:layout_height="match_parent">
</View>
<Button
android:id="#+id/confirm_bt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#ffffff"
android:background="#xml/roundedbutton"
android:text="#string/save" />
</LinearLayout>
</RelativeLayout>
I don't have idea how I can do border. I want to do a border and in the middle I want to have place to put text.This same how is in the screen. This look like a frame which have a text. Now I have onli text and I don not how I can create a frame.
Here is demo of your requirement.
1) You need to create a border.xml. Put this in your drawable folder. Add the following code in border.xml :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--stroke width and color-->
<stroke
android:width="2dp"
android:color="#android:color/darker_gray" />
<!-- corner radius-->
<corners
android:radius="5dp" />
<!--paddings-->
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
</shape>
2) Here is the layout.xml put the background to a linearlayout accordingly:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="bd.com.tahsin.myapplicationnavgroup.MainActivity"
tools:showIn="#layout/app_bar_main">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:layout_marginTop="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"
android:background="#drawable/bottom_border_help">
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MENU_BOCZNE"
android:background="#color/background_floating_material_light"
android:layout_marginLeft="10dp" />
</RelativeLayout>
3) And finally the screen-shot:
Hope, this will help a bit.
Try this,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/border"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="TEST"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text=" MENU "
android:layout_marginLeft="15dp"
android:background="#ffffff"
android:textSize="17sp" />
</RelativeLayout>
xml of border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="3dp"/>
<stroke
android:width="2dp"
android:color="#cdcdcd" />
</shape>

CheckBox at the Margin Right of Layout XML

I would like to put a Checkbox in this XML Layout. I've try many times but I always get an error.
<?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" >
<ImageView
android:id="#+id/app_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="3dp"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="5dp" >
<TextView
android:id="#+id/app_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textStyle="bold" />
<TextView
android:id="#+id/app_paackage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
</LinearLayout>
</LinearLayout>
I would like the CheckBox at the Margin Right. So, example:
IMAGE MyApplication MyPackage CheckBox AT THE MARGIN RIGHT
<?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:layout_orientation="horizontal">
<ImageView
android:id="#+id/app_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="3dp"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="5dp" >
<TextView
android:id="#+id/app_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textStyle="bold" />
<TextView
android:id="#+id/app_paackage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
</LinearLayout>
<CheckBox />
</LinearLayout>
Try like this giving layout_orientation to linear layout.

Categories

Resources