【开源】ExpandingImageMenu

ExpandingImageMenu

  •  https://github.com/SeanOxford/ExpandingImageMenu

    介绍:

    点击只显示了局部信息的菜单项,将展开图片查看更详细的信息,展开的动画过度效果根据菜单项的位置不同而不同。

    运行效果:

使用说明:

将CustomRelativeLayout放在xml的任意位置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    <?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">
 
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:id="@+id/tv_sean_oxford"
            android:textSize="45sp"
            android:includeFontPadding="false"
            android:textColor="#2e2e2e"
            android:text="Sean Oxford" />
 
        <TextView
            android:layout_marginTop="-10dp"
            android:layout_marginBottom="16dp"
            android:layout_below="@id/tv_sean_oxford"
            android:layout_alignEnd="@id/tv_sean_oxford"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/tv_android_developer"
            android:textSize="18sp"
            android:textColor="#8cac33"
            android:text="Android Developer" />
 
 
        <com.seanoxford.expandingimagemenu.views.CustomRelativeLayout
            android:layout_below="@id/tv_android_developer"
            android:id="@+id/ll_about_me"
            android:layout_alignParentBottom="true"
            android:layout_width="match_parent"
            android:splitMotionEvents="false"
            android:layout_height="match_parent">
 
        </com.seanoxford.expandingimagemenu.views.CustomRelativeLayout>
    </RelativeLayout>

 

在你的Activity或者Fragment中,手动设置CustomRelativeLayout的fragment manager:

1
2
CustomRelativeLayout customRelativeLayout = (CustomRelativeLayout) findViewById(R.id.ll_about_me);
customRelativeLayout.setFragmentManager(getSupportFragmentManager());

创建ChildLayoutView,需要的参数有context,标题,overlay颜色,背景图片,字体,fragment/xmlLayout

1
2
3
4
CustomChildLayout cclContact = new CustomChildLayout(mParentActivity, "Contact""#aa99cc00", R.drawable.contact_photo, mParentActivity.getRobotoLight(), new SubFragmentContact());
CustomChildLayout cclProf = new CustomChildLayout(mParentActivity, "Proficiencies""#ccaa66cc", R.drawable.prof_photo, mParentActivity.getRobotoLight(), new SubFragmentProficiencies());
CustomChildLayout cclExp = new CustomChildLayout(mParentActivity, "Experience""#bFff4444", R.drawable.exp_photo, mParentActivity.getRobotoLight(), new SubFragmentExperience());
CustomChildLayout cclEdu = new CustomChildLayout(mParentActivity, "Education""#aa33b5e5", R.drawable.edu_photo, mParentActivity.getRobotoLight(), new SubFragmentEducation());

 将每个CustomChildLayout添加到CustomRelativeLayout中

1
2
3
4
customRelativeLayout.addChildLayout(cclContact);
customRelativeLayout.addChildLayout(cclProf);
customRelativeLayout.addChildLayout(cclExp);
customRelativeLayout.addChildLayout(cclEdu);

 

相关代码

  • Context-Menu.Android
  • Side-Menu.Android
  • bitmapMesh
  • Android-CircleMenu
  • AndroidTreeView

posted on 2015-04-27 09:29  wasdchenhao  阅读(121)  评论(0)    收藏  举报

导航