Publish pictures, pop-up interface, similar to QQ Hair said when adding a photo interface (not very likely to say, forgive me)

Source: Internet
Author: User

First of all, it is not clear, the left is their own effect, the right is the QQ effect

OK, see here should understand the meaning of my title. haha.

First, a layout (activity_select_pic.xml)

 <?xml version= "1.0"  encoding= "Utf-8"? ><relativelayout xmlns:android= "http// Schemas.android.com/apk/res/android "    android:layout_width=" Fill_parent "     android:layout_height= "Fill_parent"     android:gravity= "Center_horizontal"  >    <linearlayout        android:id= " @+id/pop_layout_select_pic "        android:layout_width=" Fill_parent "         android:layout_height= "Wrap_content"          android:layout_alignparentbottom= "true"          android:gravity= "Center_horizontal"         android:orientation= " Vertical " >        <TextView           &Nbsp; android:id= "@+id/text_take_photo"              android:layout_width= "Fill_parent"              android:layout_height= "50.0dip"              android:layout_marginleft= "10.0dip"              android:layout_marginright= "10.0dip"              android:gravity= "Center"             android:o rientation= "Horizontal"             android:text= " Photo "            android:background=" @drawable/shape _popup_top " //here,  need to speak             android : textcolor= "#ff006cff" &nbsP;           android:textsize= "18.0SP"  />                 <View             android:layout_width= "Fill_parent"              android:layout_height= "1.0dip"              android:layout_marginleft= "10.0dip"              android:layout_marginright= "10.0dip"              android:background= "@color/liuliu_border"  />                 <textview             android:id= "@+id/text_pick_photo"      &nBsp;      android:layout_width= "Fill_parent"              android:layout_height= "50.0dip"              android:layout_marginleft= "10.0dip"              android:layout_marginright= "10.0dip"              android:gravity= "Center"              android:background= "@drawable/shape_popup_bottom"//here,  need to speak              android:orientation= "Horizontal"              android:text= "from album"              android:textcolor= "#ff006cff"              android:teXtsize= "18.0SP"  />        <View             android:layout_width= "Fill_parent"              android:layout_height= "1.0dip"              android:layout_marginleft= "10.0dip"              android:layout_marginright= "10.0dip"              android:background= "@color/liuliu_border"  />         <TextView             android:id= "@+id/text_cancle"              android:layout_width= "Fill_parent"              android:layout_height= "50.0dip" &Nbsp;           android:layout_margin= "10.0dip"              android:background= "@drawable/shape_popup"// Here,  need to speak             android:gravity= "center"             android:orientation= "Horizontal"              android:text= "Cancel"              android:textcolor= "#ff006cff"              android:textsize= "18.0SP"              android:textstyle= "Bold"  />    </LinearLayout> </RelativeLayout>

The above has been labeled 3 places to talk about, is the textview above the photo, select, cancel the three background

Are the following three files in the drawable-hdpi, respectively.

Shape_popup_top.xml, the two corners of the top of the rectangle are rounded (upper left corner, upper right corner)

<?xml version= "1.0" encoding= "Utf-8"? ><layer-list xmlns:android= "http://schemas.android.com/apk/res/ Android > <item> <shape> <solid android:color= "#ffffffff"/> <!-- Upper-left corner-right--<corners android:topleftradius= "4.0dip" android:toprightradius= "4.0dip" Android:bottomleftradi us= "0.100000024dip" android:bottomrightradius= "0.100000024dip"/> </shape> </item></layer-list >

Shape_popup_bottom.xml, the two corners of the bottom of the rectangle are rounded (lower left corner, lower right corner)

 <?xml version= "1.0"  encoding= "Utf-8"? ><layer-list  xmlns:android= "http// Schemas.android.com/apk/res/android ">    <item>         <shape>        <!--  White-->             <solid android:color= "#ffffffff"  />            <!--  lower left corner,  Lower right corner-->            <corners                  android:topleftradius= " 0.100000024dip "                  android:toprightradius= "0.100000024dip"                    android:bottomleftradius= "4.0dip"                   android:bottomrightradius= "4.0dip"  />         </shape>    </item></layer-list>

Shape_popup.xml

<?xml version= "1.0" encoding= "Utf-8"? ><layer-list xmlns:android= "http://schemas.android.com/apk/res/ Android > <item> <shape> <solid android:color= "#ffffffff"/> <!--Quad All corners are round--<corners android:radius= "4.0dip"/> </shape> </item></layer-list> ;

OK, when you get here, the layout is complete. But it's not over, there's a way out, we're going to put it down, and if it's transparent, it's going to be in the manifest.

<activity android:name= "Com.gdut.pet.ui.ActivitySelectPic" android:label= "@string/personal_centra L "android:theme=" @style/dialogstylebottom "><!--This is an activity defined in manifest, which stipulates that his theme is Dialo Gstylebottom-->

Above this is an activity defined in manifest, which stipulates that his theme is Dialogstylebottom,

Dialogstylebottom as follows (Styles.xml in the Values folder)

 <style name= "Animbottom"  parent= "@android: Style/animation" >         <item name= "Android:windowenteranimation" > @anim/push_bottom_in</item>         <item name= "Android:windowexitanimation" > @anim/push _bottom_out</item>    </style>    <style name= " Dialogstylebottom " parent=" Android:Theme.Dialog ">        < Item name= "Android:windowanimationstyle" > @style/animbottom</item>         <item name= "Android:windowframe" > @null </item>         <!--  borders  -->        <item  Name= "Android:windowisfloating" >false</item>        <!-- Whether   is on the activity &nbsP;-->        <item name= "Android:windowIsTranslucent" > true</item>        <!--  Translucent  -->         <item name= "Android:windownotitle" >true</item>         <!--  Untitled  -->         <item name= "Android:windowbackground" > @android:color/transparent</item>         <!--  Background Transparency  -->         <item name= "Android:backgrounddimenabled" >true</item>         <!--  Blur  -->    </style>

The above should be able to see clearly.

OK, also the last one, is out of the way, here to use the animation,

The file is under the Anim folder

Push_bottom_in.xml

<?xml version= "1.0" encoding= "Utf-8"?><!--up and down slide-in--><set xmlns:android= "http://schemas.android.com/ Apk/res/android "> <translate android:duration=" "Android:fromydelta=" 100%p "Android:toyd Elta= "0"/> </set>

Push_bottom_out.xml

<?xml version= "1.0" encoding= "Utf-8"?><!--up/down slide-out--><set xmlns:android= "http://schemas.android.com/ Apk/res/android "> <translate android:duration=" "android:fromydelta=" 0 "Android:toyd Elta= "50%p"/></set>

OK, we're done here, call it.

Publish pictures, pop-up interface, similar to QQ Hair said when adding a photo interface (not very likely to say, forgive me)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.