From 21c75c5b0719a9d9dfa299e643081be63cdad8fb Mon Sep 17 00:00:00 2001 From: wuhen0929 <532797233@qq.com> Date: Sat, 29 Nov 2014 14:45:42 +0800 Subject: [PATCH] refine LandingFragment --- .../demoofui/src/main/AndroidManifest.xml | 684 +++++++-- .../common/demoofui/LandingFragment.java | 1365 ++--------------- 2 files changed, 737 insertions(+), 1312 deletions(-) diff --git a/UltimateAndroidGradle/demoofui/src/main/AndroidManifest.xml b/UltimateAndroidGradle/demoofui/src/main/AndroidManifest.xml index 8729c45d..390f85b8 100644 --- a/UltimateAndroidGradle/demoofui/src/main/AndroidManifest.xml +++ b/UltimateAndroidGradle/demoofui/src/main/AndroidManifest.xml @@ -18,40 +18,128 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + android:theme="@style/Widget.AppCompat.Light.ActionBar.Solid"> + + + + @@ -63,63 +151,203 @@ - + + + + + - + + + + + - - + + + + + + + + + + - - + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + android:theme="@style/Theme.MaterialTheme"> + + + + - + android:theme="@style/MaterialMenuTheme"> + + + + + + + + + - - + + + + + + + + + + + android:theme="@style/Theme.MaterialTheme"> + + + + + android:windowSoftInputMode="stateHidden"> + + + + - + + + + + + android:theme="@style/AppTheme.Transparent"> + + + + @@ -159,36 +399,100 @@ android:name=".activityanimation.DoorActivity" android:theme="@style/AppTheme.Transparent"> - + + + + + - - + + + + + + + + + + - - + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + + + + + - + + + + + @@ -200,24 +504,64 @@ - - - - + + + + + + + + + + + + + + + + + + + + - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -225,16 +569,28 @@ - + + + + + - + + + + + - + + + + + @@ -244,63 +600,163 @@ - + + + + + - + + + + + - + + + + + - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - + android:theme="@style/android:Theme.Holo.Light.DarkActionBar"> + + + + + + + + + - + + + + + - - + android:theme="@style/android:Theme.Holo.Light.DarkActionBar"> + + + + + + + + + + + + + + - + android:theme="@style/PagerSlidingTabStrip"> + + + + + + + + + - + + + + + - + + + + + + android:theme="@style/Theme.AppCompat.Light.DarkActionBar"> + + + + - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/UltimateAndroidGradle/demoofui/src/main/java/com/marshalchen/common/demoofui/LandingFragment.java b/UltimateAndroidGradle/demoofui/src/main/java/com/marshalchen/common/demoofui/LandingFragment.java index e70fc29d..55e84a63 100644 --- a/UltimateAndroidGradle/demoofui/src/main/java/com/marshalchen/common/demoofui/LandingFragment.java +++ b/UltimateAndroidGradle/demoofui/src/main/java/com/marshalchen/common/demoofui/LandingFragment.java @@ -1,7 +1,8 @@ package com.marshalchen.common.demoofui; - import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -12,89 +13,33 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.*; - -import com.marshalchen.common.demoofui.BlurNavigationDrawer.BlurNavigationDrawerActivity; -import com.marshalchen.common.demoofui.androidanimationsdemo.AndroidAnimationsDemoActivity; +import android.widget.AdapterView; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.TextView; -import butterknife.ButterKnife; -import butterknife.InjectView; - -import com.marshalchen.common.commonUtils.basicUtils.BasicUtils; -import com.marshalchen.common.demoofui.ResideMenuDemo.ResideMenuActivity; -import com.marshalchen.common.demoofui.artbook.FreeFlowArtbookActivity; -import com.marshalchen.common.demoofui.blurdialogfragment.BlurDialogActivity; -import com.marshalchen.common.demoofui.circularProgressButton.CircularProgressButtonActivity; -import com.marshalchen.common.demoofui.circularfloatingactionmenu.CircularFloatingActivity; -import com.marshalchen.common.demoofui.dragSortListview.MultipleChoiceListView; -import com.marshalchen.common.demoofui.dragSortListview.SingleChoiceListView; -import com.marshalchen.common.demoofui.easingDemo.EasingActivity; -import com.marshalchen.common.demoofui.easyandroidanimations.EasyAnimationListActivity; -import com.marshalchen.common.demoofui.edgeeffectoverride.EdgeEffectActivity; -import com.marshalchen.common.demoofui.fadingactionbar.HomeActivity; -import com.marshalchen.common.demoofui.fancyCoverFlow.FancyCoverFlowActivity; -import com.marshalchen.common.demoofui.imageprocessingexample.ImageProcessingActivity; -import com.marshalchen.common.demoofui.imageprocessingexample.ImageProcessingVideotoImageActivity; -import com.marshalchen.common.demoofui.materialdesigndemo.MaterialDesignActivity; -import com.marshalchen.common.demoofui.materialmenu.MaterialMenuAppcompatActivity; -import com.marshalchen.common.demoofui.materialmenu.MaterialMenuToolbarActivity; -import com.marshalchen.common.demoofui.materialripple.MaterialRippleActivity; -import com.marshalchen.common.demoofui.pagerSlidingTabStrip.PagerSlidingTabStripActivity; -import com.marshalchen.common.demoofui.pulltozoomview.PullToZoomActivity; -import com.marshalchen.common.demoofui.recyclerplayground.RecyclerViewPlayGroundActivity; -import com.marshalchen.common.demoofui.recyclerviewitemanimator.RecyclerViewItemAnimatorActivity; -import com.marshalchen.common.demoofui.recyclerviewstickyheaders.RecyclerViewStickyHeadersActivity; -import com.marshalchen.common.demoofui.rippleDrawable.RippleDrawableActivity; -import com.marshalchen.common.demoofui.roundedimageview.RoundedImageViewActivity; -import com.marshalchen.common.demoofui.sampleModules.GoogleProgressBarActivity; -import com.marshalchen.common.demoofui.quickreturnlistview.QuickReturnListViewActivity; -import com.marshalchen.common.demoofui.shapeimageview.ShapeImageViewActivity; -import com.marshalchen.common.demoofui.slider.SliderActivity; -import com.marshalchen.common.demoofui.smoothswitch.SwitchAnimationActivity; -import com.marshalchen.common.demoofui.staggeredgridview.StaggeredGridViewActivity; -import com.marshalchen.common.demoofui.standUpTimer.ConfigureStandupTimer; -import com.marshalchen.common.demoofui.superlistview.SuperListViewActivity; -import com.marshalchen.common.demoofui.swipelayoutdemo.SwipeLayoutActivity; -import com.marshalchen.common.demoofui.switchbuttondemo.SwitchButtonActivity; -import com.marshalchen.common.demoofui.twowayview.TwoWayViewActivity; import com.marshalchen.common.ui.Typefaces; -import com.marshalchen.common.uimodule.arcmenu.ArcMenu; import com.marshalchen.common.uimodule.enhanceListView.EnhancedListView; -import com.marshalchen.common.uimodule.passcodelock.PasscodePreferencesActivity; import com.marshalchen.common.uimodule.titanic.Titanic; import com.marshalchen.common.uimodule.titanic.TitanicTextView; import com.marshalchen.common.uimodule.viewpagerindicator.CirclePageIndicator; -import com.marshalchen.common.demoofui.activityanimation.ActivityAnimationsActivity; -import com.marshalchen.common.demoofui.activitytransition.ActivityTransitionActivity; -import com.marshalchen.common.demoofui.cooldraganddrop.CoolDragAndDropActivity; -import com.marshalchen.common.demoofui.discrollview.DiscrollActivity; -import com.marshalchen.common.demoofui.dynamicgrid.example.DynamicGridActivity; -import com.marshalchen.common.demoofui.foldableLayout.activities.FoldableListActivity; -import com.marshalchen.common.demoofui.foldableLayout.activities.UnfoldableDetailsActivity; -import com.marshalchen.common.demoofui.foldingDrawer.FoldingActivitys; -import com.marshalchen.common.demoofui.listbuddies.ListBuddiesActivity; -import com.marshalchen.common.demoofui.listviewanimations.ListAnimationActivity; -import com.marshalchen.common.demoofui.listviewfilter.ui.ListViewFilterActivity; -import com.marshalchen.common.demoofui.parallaxscrollexample.ParallaxScrollActivity; -import com.marshalchen.common.demoofui.pullscrollview.PullScrollViewActivity; -import com.marshalchen.common.demoofui.rebound.ReboundActivity; -import com.marshalchen.common.demoofui.rebound.ReboundActivitySimple; -import com.marshalchen.common.demoofui.sampleModules.*; -import com.marshalchen.common.demoofui.showcaseview.ShowCaseSampleActivity; -import com.marshalchen.common.demoofui.stickygridheadersexample.StickGridItemListActivity; -import com.marshalchen.common.demoofui.jsoup.UtilsDemoActivity; -import com.marshalchen.common.demoofui.viewpagerSlidingTab.ViewpagerSlidingTabsActivity; +import java.text.Collator; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; +import java.util.Map; +import butterknife.ButterKnife; +import butterknife.InjectView; public class LandingFragment extends Fragment { View mainView; @InjectView(R.id.landingEnhanceListView) EnhancedListView landingEnhanceListView; - List> enhanceList = new ArrayList<>(); + List> enhanceList; EnhancedListAdapter enhancedListAdapter; @InjectView(R.id.landingMallViewpager) ViewPager landingMallViewpager; @@ -105,14 +50,15 @@ public class LandingFragment extends Fragment { TitanicTextView titanicTextView; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - mainView = inflater.inflate(R.layout.landing_fragment, container, false); + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + mainView = inflater + .inflate(R.layout.landing_fragment, container, false); ButterKnife.inject(this, mainView); initTitanicView(); initEnhanceList(); initViewPager(); - - //CryptoUtils.testCrypto(getActivity()); + // CryptoUtils.testCrypto(getActivity()); return mainView; } @@ -125,8 +71,9 @@ public void onDestroyView() { private void initTitanicView() { titanic = new Titanic(); titanic.start(titanicTextView); - titanicTextView.setTypeface(Typefaces.get(getActivity(), "Satisfy-Regular.ttf")); - // HandlerUtils.sendMessageHandlerDelay(titanicHandler, 0, 3000); + titanicTextView.setTypeface(Typefaces.get(getActivity(), + "Satisfy-Regular.ttf")); + // HandlerUtils.sendMessageHandlerDelay(titanicHandler, 0, 3000); } Handler titanicHandler = new Handler() { @@ -139,1107 +86,129 @@ public void handleMessage(Message msg) { }; private void initEnhanceList() { - HashMap map = new HashMap<>(); - - map.put("name", "SmoothBar"); - map.put("detail", "try"); - map.put("subname", "to ProgressBar"); - map.put("class", "SmoothProgressBarActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RippleEffect"); - map.put("detail", "try"); - map.put("subname", "RippleEffect"); - map.put("class", "RippleEffectActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Floating"); - map.put("detail", "try"); - map.put("subname", "FloatingActionButton"); - map.put("class", "FloatedActionButtonActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Floating"); - map.put("detail", "try"); - map.put("subname", "FloatingActionButton"); - map.put("class", "FloatingActionButtonDemo"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CircularMenu"); - map.put("detail", "try"); - map.put("subname", "CircularMenu"); - map.put("class", "CircularFloatingActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialMenu"); - map.put("detail", "try"); - map.put("subname", "ToolbarActivity"); - map.put("class", "MaterialMenuToolbarActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialMenu"); - map.put("detail", "try"); - map.put("subname", "AppcompatActivity"); - map.put("class", "MaterialMenuAppcompatActivity"); - enhanceList.add(map); - - map = new HashMap<>(); - map.put("name", "DynamicGrid"); - map.put("detail", "try"); - map.put("subname", "to DynamicGrid"); - map.put("class", "DynamicGridActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Cool Drag Drop "); - map.put("detail", "try"); - map.put("subname", "to DragDrop"); - map.put("class", "CoolDragAndDropActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Stickyheader"); - map.put("detail", "try"); - map.put("subname", "to StickyHeader"); - map.put("class", "StickGridItemListActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ListViewFilter"); - map.put("detail", "try"); - map.put("subname", "to ListViewFilter"); - map.put("class", "ListViewFilterActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FlipView"); - map.put("detail", "try"); - map.put("subname", "to FlipView"); - map.put("class", "FlipViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Photoview"); - map.put("detail", "try"); - map.put("subname", "to Photoview"); - map.put("class", "PhotoViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FoldingActivity"); - map.put("detail", "try"); - map.put("subname", "to Folding"); - map.put("class", "FoldingActivitys"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CircularBar"); - map.put("detail", "try"); - map.put("subname", "to CircularBar"); - map.put("class", "CircularBarActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FoldableList"); - map.put("detail", "try"); - map.put("subname", "to FoldableList"); - map.put("class", "FoldableListActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "UnfoldableList"); - map.put("detail", "try"); - map.put("subname", "to UnfoldableList"); - map.put("class", "UnfoldableDetailsActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "TimeSquare"); - map.put("detail", "try"); - map.put("subname", "to TimeSquare"); - map.put("class", "CalendarSquareActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FaceCrop"); - map.put("detail", "try"); - map.put("subname", "to FaceCrop"); - map.put("class", "FaceCropActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "KenBurns"); - map.put("detail", "try"); - map.put("subname", "to KenBurns"); - map.put("class", "KenBurnsViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Discroll"); - map.put("detail", "try"); - map.put("subname", "to Discroll"); - map.put("class", "DiscrollActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Panning"); - map.put("detail", "try"); - map.put("subname", "to Panning"); - map.put("class", "PanningViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ParScroll"); - map.put("detail", "try"); - map.put("subname", "to ParScroll"); - map.put("class", "ParallaxScrollActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ProgressWheel"); - map.put("detail", "try"); - map.put("subname", "to Wheel"); - map.put("class", "ProgressbarWheelActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ViewTabs"); - map.put("detail", "try"); - map.put("subname", "to ViewTabs"); - map.put("class", "ViewpagerSlidingTabsActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Rebound"); - map.put("detail", "try"); - map.put("subname", "Rebound"); - map.put("class", "ReboundActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ReboundSimple"); - map.put("detail", "try"); - map.put("subname", "Rebound"); - map.put("class", "ReboundActivitySimple"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ListAnim"); - map.put("detail", "try"); - map.put("subname", "ListAnim"); - map.put("class", "ListAnimationActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "PullSplash"); - map.put("detail", "try"); - map.put("subname", "PullSplash"); - map.put("class", "PullSplashActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Jsoup"); - map.put("detail", "try"); - map.put("subname", "Jsoup"); - map.put("class", "UtilsDemoActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ViewServer"); - map.put("detail", "try"); - map.put("subname", "ViewServer"); - map.put("class", "ViewServerActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "PassCode"); - map.put("detail", "try"); - map.put("subname", "PassCode"); - map.put("class", "PasscodePreferencesActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "GestureTouch"); - map.put("detail", "try"); - map.put("subname", "GestureTouch"); - map.put("class", "GestureTouchActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "act_anim"); - map.put("detail", "try"); - map.put("subname", "act_anim"); - map.put("class", "ActivityAnimationsActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "pullscrollview"); - map.put("detail", "try"); - map.put("subname", "pull"); - map.put("class", "PullScrollViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "card swiped"); - map.put("detail", "try"); - map.put("subname", "card swiped"); - map.put("class", "CardsSwipedActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ShowCase"); - map.put("detail", "try"); - map.put("subname", "ShowCase"); - map.put("class", "ShowCaseSampleActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ListBuddies"); - map.put("detail", "try"); - map.put("subname", "ListBuddies"); - map.put("class", "ListBuddiesActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ActivityTransition"); - map.put("detail", "try"); - map.put("subname", "act"); - map.put("class", "ActivityTransitionActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "AutoFit"); - map.put("detail", "try"); - map.put("subname", "AutoFit"); - map.put("class", "AutofitTextViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Draggable"); - map.put("detail", "try"); - map.put("subname", "Draggable"); - map.put("class", "DraggableGridViewPagerTestActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FloatLayout"); - map.put("detail", "try"); - map.put("subname", "FloatLayout"); - map.put("class", "FloatLabelActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "WireFrame"); - map.put("detail", "try"); - map.put("subname", "WireFrame"); - map.put("class", "WireFrameActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Trigle"); - map.put("detail", "try"); - map.put("subname", "Frame"); - map.put("class", "TriangleFrameActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RiseNumber"); - map.put("detail", "try"); - map.put("subname", "RiseNumber"); - map.put("class", "RiseNumberActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Nifty"); - map.put("detail", "try"); - map.put("subname", "Nifty"); - map.put("class", "NiftyDialogActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Icons"); - map.put("detail", "try"); - map.put("subname", "Icons"); - map.put("class", "DifferentIconsActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "EdgeEffect"); - map.put("detail", "try"); - map.put("subname", "EdgeEffect"); - map.put("class", "EdgeEffectActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ViewPager"); - map.put("detail", "try"); - map.put("subname", "Transform"); - map.put("class", "ViewPagerTransformerActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "StandUpTimer"); - map.put("detail", "try"); - map.put("subname", "Timer"); - map.put("class", "ConfigureStandupTimer"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CircularProgress"); - map.put("detail", "try"); - map.put("subname", "Button"); - map.put("class", "CircularProgressButtonActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "JazzyViewPager"); - map.put("detail", "try"); - map.put("subname", "Jazzy"); - map.put("class", "JazzyViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "PulltoZoom"); - map.put("detail", "try"); - map.put("subname", "ListView"); - map.put("class", "PulltoZoomListViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "QuickReturn"); - map.put("detail", "try"); - map.put("subname", "ListView"); - map.put("class", "QuickReturnListViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "SuperListview"); - map.put("detail", "try"); - map.put("subname", "ListView"); - map.put("class", "SuperListViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Staggered"); - map.put("detail", "try"); - map.put("subname", "GridView"); - map.put("class", "StaggeredGridViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "DropDownListview"); - map.put("detail", "try"); - map.put("subname", "ListView"); - map.put("class", "DropDownListViewDemo"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FlowTextView"); - map.put("detail", "try"); - map.put("subname", "TextView"); - map.put("class", "FlowTextViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Google"); - map.put("detail", "try"); - map.put("subname", "ProgressBar"); - map.put("class", "GoogleProgressBarActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Number"); - map.put("detail", "try"); - map.put("subname", "ProgressBar"); - map.put("class", "NumberProgressBarActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FancyCoverFlow"); - map.put("detail", "try"); - map.put("subname", "FancyCoverFlow"); - map.put("class", "FancyCoverFlowActivity"); - enhanceList.add(map); - - map = new HashMap<>(); - map.put("name", "DragSort"); - map.put("detail", "try"); - map.put("subname", "Listview"); - map.put("class", "SingleChoiceListView"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "DragSort"); - map.put("detail", "try"); - map.put("subname", "Listview"); - map.put("class", "MultipleChoiceListView"); - enhanceList.add(map); -// map = new HashMap<>(); -// map.put("name", "FadingActionbar"); -// map.put("detail", "try"); -// map.put("subname", "FadingActionbar"); -// map.put("class", "HomeActivity"); -// enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "SwipeFreshLayout"); - map.put("detail", "try"); - map.put("subname", "Layout"); - map.put("class", "SwipeRefreshLayoutDemo"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "UltimateListview"); - map.put("detail", "try"); - map.put("subname", "Listview"); - map.put("class", "UltimateListviewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ResideMenu"); - map.put("detail", "try"); - map.put("subname", "ResideMenu"); - map.put("class", "ResideMenuActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Swipe"); - map.put("detail", "try"); - map.put("subname", "SwipeLayout"); - map.put("class", "SwipeLayoutActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Animations"); - map.put("detail", "try"); - map.put("subname", "Animations"); - map.put("class", "AndroidAnimationsDemoActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Easing"); - map.put("detail", "try"); - map.put("subname", "Activity"); - map.put("class", "EasingActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "JumpingBeans"); - map.put("detail", "try"); - map.put("subname", "Activity"); - map.put("class", "JumpingBeansActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "AndroidViewHover"); - map.put("detail", "try"); - map.put("subname", "Hover"); - map.put("class", "AndroidViewHoverActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "Slider"); - map.put("detail", "try"); - map.put("subname", "Slider"); - map.put("class", "SliderActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CalendarListView"); - map.put("detail", "try"); - map.put("subname", "CalendarListView"); - map.put("class", "CalendarListViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "EasyAnimation"); - map.put("detail", "try"); - map.put("subname", "EasyAnimation"); - map.put("class", "EasyAnimationListActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ImageProcessing"); - map.put("detail", "try"); - map.put("subname", "ImageProcessing"); - map.put("class", "ImageProcessingActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ImageProcessing"); - map.put("detail", "try"); - map.put("subname", "VideotoImage"); - map.put("class", "ImageProcessingVideotoImageActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "TestHtml5Video"); - map.put("detail", "try"); - map.put("subname", "TestHtml5Video"); - map.put("class", "TestHTML5WebView"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CropImage"); - map.put("detail", "try"); - map.put("subname", "CropImage"); - map.put("class", "CropperSample"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CropperImage"); - map.put("detail", "try"); - map.put("subname", "CropperImage"); - map.put("class", "CropExample"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ImageFilter"); - map.put("detail", "try"); - map.put("subname", "ImageFilter"); - map.put("class", "ImageFilterActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MotionSample"); - map.put("detail", "try"); - map.put("subname", "MotionSample"); - map.put("class", "MotionSampleActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ShapeImage"); - map.put("detail", "try"); - map.put("subname", "ShapeImage"); - map.put("class", "ShapeImageViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CustomShapeImage"); - map.put("detail", "try"); - map.put("subname", "CustomShapeImage"); - map.put("class", "CustomShapeImageViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MarqueeView"); - map.put("detail", "try"); - map.put("subname", "MarqueeView"); - map.put("class", "MarqueeViewSample"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "SignaturePad"); - map.put("detail", "try"); - map.put("subname", "SignaturePad"); - map.put("class", "SignaturePadActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "DrawView"); - map.put("detail", "try"); - map.put("subname", "DrawviewActivity"); - map.put("class", "DrawableActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "WeekView"); - map.put("detail", "try"); - map.put("subname", "AndroidWeekView"); - map.put("class", "AndroidWeekViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "AnimationFilcker"); - map.put("detail", "try"); - map.put("subname", "AnimationFilcker"); - map.put("class", "FilckerAnimationListActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ArcMenu"); - map.put("detail", "try"); - map.put("subname", "ArcMenu"); - map.put("class", "ArcMenuActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "ExpandCircle"); - map.put("detail", "try"); - map.put("subname", "ExpandCircle"); - map.put("class", "ExpandCircleProgressExampleActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FreeFlow"); - map.put("detail", "try"); - map.put("subname", "ArtBook"); - map.put("class", "FreeFlowArtbookActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "FreeFlow"); - map.put("detail", "try"); - map.put("subname", "PhotoGrid"); - map.put("class", "FreeFlowPhotoGridActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RecylerView"); - map.put("detail", "try"); - map.put("subname", "RecylerViewSample"); - map.put("class", "RecyclerViewSample"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RecylerView"); - map.put("detail", "try"); - map.put("subname", "RecylerViewItem"); - map.put("class", "RecyclerViewItemAnimatorActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "PullToZoom"); - map.put("detail", "try"); - map.put("subname", "PullToZoomActivity"); - map.put("class", "PullToZoomActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "TwoWayView"); - map.put("detail", "try"); - map.put("subname", "TwoWayViewActivity"); - map.put("class", "TwoWayViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RecyclerView"); - map.put("detail", "try"); - map.put("subname", "PlayGround"); - map.put("class", "RecyclerViewPlayGroundActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "StickyHeaders"); - map.put("detail", "try"); - map.put("subname", "RecyclerView"); - map.put("class", "RecyclerViewStickyHeadersActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RoundedImage"); - map.put("detail", "try"); - map.put("subname", "RoundedImageViewActivity"); - map.put("class", "RoundedImageViewActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "BlurNavi"); - map.put("detail", "try"); - map.put("subname", "BlurNavigationDrawerActivity"); - map.put("class", "BlurNavigationDrawerActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "BlurDialog"); - map.put("detail", "try"); - map.put("subname", "BlurDialogActivity"); - map.put("class", "BlurDialogActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CustomSwipe"); - map.put("detail", "try"); - map.put("subname", "CustomPullToRefreshActivity"); - map.put("class", "CustomPullToRefreshActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialEditText"); - map.put("detail", "try"); - map.put("subname", "MaterialEditTextActivity"); - map.put("class", "MaterialEditTextActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RippleBackground"); - map.put("detail", "try"); - map.put("subname", "RippleBackgroundActivity"); - map.put("class", "RippleBackgroundActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "PagerSlidingTab"); - map.put("detail", "try"); - map.put("subname", "PagerSlidingTabStripActivity"); - map.put("class", "PagerSlidingTabStripActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialRipple"); - map.put("detail", "try"); - map.put("subname", "MaterialRippleActivity"); - map.put("class", "MaterialRippleActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "CircleProgress"); - map.put("detail", "try"); - map.put("subname", "CircleProgressActivity"); - map.put("class", "CircleProgressActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialDesign"); - map.put("detail", "try"); - map.put("subname", "MaterialDesignActivity"); - map.put("class", "MaterialDesignActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "SwitchAnim"); - map.put("detail", "try"); - map.put("subname", "SwitchAnimationActivity"); - map.put("class", "SwitchAnimationActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "RippleDrawable"); - map.put("detail", "try"); - map.put("subname", "RippleDrawActivity"); - map.put("class", "RippleDrawableActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MaterialProgress"); - map.put("detail", "try"); - map.put("subname", "MaterialProgress"); - map.put("class", "MaterialProgressWheelActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "MenuCircle"); - map.put("detail", "try"); - map.put("subname", "MenuCircleShowingAnimation"); - map.put("class", "MenuCircleShowingAnimationActivity"); - enhanceList.add(map); - map = new HashMap<>(); - map.put("name", "SwitchButton"); - map.put("detail", "try"); - map.put("subname", "SwitchButtonActivity"); - map.put("class", "SwitchButtonActivity"); - enhanceList.add(map); - + enhanceList = getData("com.marshalchen.common.demoofui.sampleModules"); enhancedListAdapter = new EnhancedListAdapter(enhanceList); + landingEnhanceListView.setAdapter(enhancedListAdapter); - landingEnhanceListView.setDismissCallback(new EnhancedListView.OnDismissCallback() { - @Override - public EnhancedListView.Undoable onDismiss(EnhancedListView listView, int position) { - enhancedListAdapter.remove(position); - return null; - } - }); + landingEnhanceListView + .setDismissCallback(new EnhancedListView.OnDismissCallback() { + @Override + public EnhancedListView.Undoable onDismiss( + EnhancedListView listView, int position) { + enhancedListAdapter.remove(position); + return null; + } + }); landingEnhanceListView.setSwipingLayout(R.id.swiping_layout); landingEnhanceListView.setUndoStyle(null); landingEnhanceListView.enableSwipeToDismiss(); - landingEnhanceListView.setSwipeDirection(EnhancedListView.SwipeDirection.START); - landingEnhanceListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - switch (enhanceList.get(position).get("class")) { - case "SmoothProgressBarActivity": - BasicUtils.sendIntent(getActivity(), SmoothProgressBarActivity.class); - break; - case "DynamicGridActivity": - BasicUtils.sendIntent(getActivity(), DynamicGridActivity.class); - break; - case "CoolDragAndDropActivity": - BasicUtils.sendIntent(getActivity(), CoolDragAndDropActivity.class); - break; - case "StickGridItemListActivity": - BasicUtils.sendIntent(getActivity(), StickGridItemListActivity.class); - break; - case "ListViewFilterActivity": - BasicUtils.sendIntent(getActivity(), ListViewFilterActivity.class); - break; - case "FlipViewActivity": - BasicUtils.sendIntent(getActivity(), FlipViewActivity.class); - break; - case "PhotoViewActivity": - BasicUtils.sendIntent(getActivity(), PhotoViewActivity.class); - break; - case "FoldingActivitys": - BasicUtils.sendIntent(getActivity(), FoldingActivitys.class); - break; - case "CircularBarActivity": - BasicUtils.sendIntent(getActivity(), CircularBarActivity.class); - break; - case "FoldableListActivity": - BasicUtils.sendIntent(getActivity(), FoldableListActivity.class); - break; - case "UnfoldableDetailsActivity": - BasicUtils.sendIntent(getActivity(), UnfoldableDetailsActivity.class); - break; - case "CalendarSquareActivity": - BasicUtils.sendIntent(getActivity(), CalendarSquareActivity.class); - break; - case "FaceCropActivity": - BasicUtils.sendIntent(getActivity(), FaceCropActivity.class); - break; - case "KenBurnsViewActivity": - BasicUtils.sendIntent(getActivity(), KenBurnsViewActivity.class); - break; - case "DiscrollActivity": - BasicUtils.sendIntent(getActivity(), DiscrollActivity.class); - break; - case "PanningViewActivity": - BasicUtils.sendIntent(getActivity(), PanningViewActivity.class); - break; - case "ParallaxScrollActivity": - BasicUtils.sendIntent(getActivity(), ParallaxScrollActivity.class); - break; - case "ProgressbarWheelActivity": - BasicUtils.sendIntent(getActivity(), ProgressbarWheelActivity.class); - break; - case "ViewpagerSlidingTabsActivity": - BasicUtils.sendIntent(getActivity(), ViewpagerSlidingTabsActivity.class); - break; - case "ReboundActivity": - BasicUtils.sendIntent(getActivity(), ReboundActivity.class); - break; - case "ReboundActivitySimple": - BasicUtils.sendIntent(getActivity(), ReboundActivitySimple.class); - break; - case "ListAnimationActivity": - BasicUtils.sendIntent(getActivity(), ListAnimationActivity.class); - break; - case "PullSplashActivity": - BasicUtils.sendIntent(getActivity(), PullSplashActivity.class); - break; - case "UtilsDemoActivity": - BasicUtils.sendIntent(getActivity(), UtilsDemoActivity.class); - break; - case "ViewServerActivity": - BasicUtils.sendIntent(getActivity(), ViewServerActivity.class); - break; - case "PasscodePreferencesActivity": - BasicUtils.sendIntent(getActivity(), PasscodePreferencesActivity.class); - break; - case "GestureTouchActivity": - BasicUtils.sendIntent(getActivity(), GestureTouchActivity.class); - break; - case "ActivityAnimationsActivity": - BasicUtils.sendIntent(getActivity(), ActivityAnimationsActivity.class); - break; - case "PullScrollViewActivity": - BasicUtils.sendIntent(getActivity(), PullScrollViewActivity.class); - break; - case "CardsSwipedActivity": - BasicUtils.sendIntent(getActivity(), CardsSwipedActivity.class); - break; - case "ShowCaseSampleActivity": - BasicUtils.sendIntent(getActivity(), ShowCaseSampleActivity.class); - break; - case "ListBuddiesActivity": - BasicUtils.sendIntent(getActivity(), ListBuddiesActivity.class); - break; -// case 32: -// BasicUtils.sendIntent(getActivity(), ResideMenuActivity.class); -// break; - case "ActivityTransitionActivity": - BasicUtils.sendIntent(getActivity(), ActivityTransitionActivity.class); - break; - case "AutofitTextViewActivity": - BasicUtils.sendIntent(getActivity(), AutofitTextViewActivity.class); - break; - case "DraggableGridViewPagerTestActivity": - BasicUtils.sendIntent(getActivity(), DraggableGridViewPagerTestActivity.class); - break; - case "FloatLabelActivity": - BasicUtils.sendIntent(getActivity(), FloatLabelActivity.class); - break; - case "WireFrameActivity": - BasicUtils.sendIntent(getActivity(), WireFrameActivity.class); - break; - case "TriangleFrameActivity": - BasicUtils.sendIntent(getActivity(), TriangleFrameActivity.class); - break; - case "RiseNumberActivity": - BasicUtils.sendIntent(getActivity(), RiseNumberActivity.class); - break; - case "NiftyDialogActivity": - BasicUtils.sendIntent(getActivity(), NiftyDialogActivity.class); - break; - case "DifferentIconsActivity": - BasicUtils.sendIntent(getActivity(), DifferentIconsActivity.class); - break; - case "EdgeEffectActivity": - BasicUtils.sendIntent(getActivity(), EdgeEffectActivity.class); - break; - case "ViewPagerTransformerActivity": - BasicUtils.sendIntent(getActivity(), ViewPagerTransformerActivity.class); - break; - case "ConfigureStandupTimer": - BasicUtils.sendIntent(getActivity(), ConfigureStandupTimer.class); - break; - case "CircularProgressButtonActivity": - BasicUtils.sendIntent(getActivity(), CircularProgressButtonActivity.class); - break; - case "JazzyViewActivity": - BasicUtils.sendIntent(getActivity(), JazzyViewActivity.class); - break; - case "PulltoZoomListViewActivity": - BasicUtils.sendIntent(getActivity(), PulltoZoomListViewActivity.class); - break; - case "QuickReturnListViewActivity": - BasicUtils.sendIntent(getActivity(), QuickReturnListViewActivity.class); - break; - case "SuperListViewActivity": - BasicUtils.sendIntent(getActivity(), SuperListViewActivity.class); - break; - case "StaggeredGridViewActivity": - BasicUtils.sendIntent(getActivity(), StaggeredGridViewActivity.class); - break; - case "DropDownListViewDemo": - BasicUtils.sendIntent(getActivity(), DropDownListViewDemo.class); - break; - case "FlowTextViewActivity": - BasicUtils.sendIntent(getActivity(), FlowTextViewActivity.class); - break; - case "GoogleProgressBarActivity": - BasicUtils.sendIntent(getActivity(), GoogleProgressBarActivity.class); - break; - case "NumberProgressBarActivity": - BasicUtils.sendIntent(getActivity(), NumberProgressBarActivity.class); - break; - case "FancyCoverFlowActivity": - BasicUtils.sendIntent(getActivity(), FancyCoverFlowActivity.class); - break; - case "SingleChoiceListView": - BasicUtils.sendIntent(getActivity(), SingleChoiceListView.class); - break; - case "MultipleChoiceListView": - BasicUtils.sendIntent(getActivity(), MultipleChoiceListView.class); - break; - case "HomeActivity": - BasicUtils.sendIntent(getActivity(), HomeActivity.class); - break; - case "SwipeRefreshLayoutDemo": - BasicUtils.sendIntent(getActivity(), SwipeRefreshLayoutDemo.class); - break; - case "UltimateListviewActivity": - BasicUtils.sendIntent(getActivity(), UltimateListviewActivity.class); - break; - case "ResideMenuActivity": - BasicUtils.sendIntent(getActivity(), ResideMenuActivity.class); - break; - case "SwipeLayoutActivity": - BasicUtils.sendIntent(getActivity(), SwipeLayoutActivity.class); - break; - case "AndroidAnimationsDemoActivity": - BasicUtils.sendIntent(getActivity(), AndroidAnimationsDemoActivity.class); - break; - case "EasingActivity": - BasicUtils.sendIntent(getActivity(), EasingActivity.class); - break; - case "JumpingBeansActivity": - BasicUtils.sendIntent(getActivity(), JumpingBeansActivity.class); - break; - case "AndroidViewHoverActivity": - BasicUtils.sendIntent(getActivity(), AndroidViewHoverActivity.class); - break; - case "SliderActivity": - BasicUtils.sendIntent(getActivity(), SliderActivity.class); - break; - case "CalendarListViewActivity": - BasicUtils.sendIntent(getActivity(), CalendarListViewActivity.class); - break; - case "EasyAnimationListActivity": - BasicUtils.sendIntent(getActivity(), EasyAnimationListActivity.class); - break; - case "ImageProcessingActivity": - BasicUtils.sendIntent(getActivity(), ImageProcessingActivity.class); - break; - case "ImageProcessingVideotoImageActivity": - BasicUtils.sendIntent(getActivity(), ImageProcessingVideotoImageActivity.class); - break; - case "TestHTML5WebView": - BasicUtils.sendIntent(getActivity(), TestHTML5WebView.class); - break; - case "CropExample": - BasicUtils.sendIntent(getActivity(), CropExample.class); - break; - case "CropperSample": - BasicUtils.sendIntent(getActivity(), CropperSample.class); - break; - case "ImageFilterActivity": - BasicUtils.sendIntent(getActivity(), ImageFilterActivity.class); - break; - case "MotionSampleActivity": - BasicUtils.sendIntent(getActivity(), MotionSampleActivity.class); - break; - case "ShapeImageViewActivity": - BasicUtils.sendIntent(getActivity(), ShapeImageViewActivity.class); - break; - case "CustomShapeImageViewActivity": - BasicUtils.sendIntent(getActivity(), CustomShapeImageViewActivity.class); - break; - case "MarqueeViewSample": - BasicUtils.sendIntent(getActivity(), MarqueeViewSample.class); - break; - case "SignaturePadActivity": - BasicUtils.sendIntent(getActivity(), SignaturePadActivity.class); - break; - case "DrawableActivity": - BasicUtils.sendIntent(getActivity(), DrawableActivity.class); - break; - case "AndroidWeekViewActivity": - BasicUtils.sendIntent(getActivity(), AndroidWeekViewActivity.class); - break; - case "FilckerAnimationListActivity": - BasicUtils.sendIntent(getActivity(), FilckerAnimationListActivity.class); - break; - case "ArcMenuActivity": - BasicUtils.sendIntent(getActivity(), ArcMenuActivity.class); - break; - case "ExpandCircleProgressExampleActivity": - BasicUtils.sendIntent(getActivity(), ExpandCircleProgressExampleActivity.class); - break; - case "FreeFlowArtbookActivity": - BasicUtils.sendIntent(getActivity(), FreeFlowArtbookActivity.class); - break; - case "FreeFlowPhotoGridActivity": - BasicUtils.sendIntent(getActivity(), FreeFlowPhotoGridActivity.class); - break; - case "RecyclerViewSample": - BasicUtils.sendIntent(getActivity(), RecyclerViewSample.class); - break; - case "RecyclerViewItemAnimatorActivity": - BasicUtils.sendIntent(getActivity(), RecyclerViewItemAnimatorActivity.class); - break; - case "RippleEffectActivity": - BasicUtils.sendIntent(getActivity(), RippleEffectActivity.class); - break; - case "FloatedActionButtonActivity": - BasicUtils.sendIntent(getActivity(), FloatingActionButtonActivity.class); - break; - case "FloatingActionButtonDemo": - BasicUtils.sendIntent(getActivity(), FloatingActionButtonDemo.class); - break; - case "CircularFloatingActivity": - BasicUtils.sendIntent(getActivity(), CircularFloatingActivity.class); - break; - case "MaterialMenuToolbarActivity": - BasicUtils.sendIntent(getActivity(), MaterialMenuToolbarActivity.class); - break; - case "MaterialMenuAppcompatActivity": - BasicUtils.sendIntent(getActivity(), MaterialMenuAppcompatActivity.class); - break; - case "PullToZoomActivity": - BasicUtils.sendIntent(getActivity(), PullToZoomActivity.class); - break; - case "TwoWayViewActivity": - BasicUtils.sendIntent(getActivity(), TwoWayViewActivity.class); - break; - case "RecyclerViewPlayGroundActivity": - BasicUtils.sendIntent(getActivity(), RecyclerViewPlayGroundActivity.class); - break; - case "RecyclerViewStickyHeadersActivity": - BasicUtils.sendIntent(getActivity(), RecyclerViewStickyHeadersActivity.class); - break; - case "RoundedImageViewActivity": - BasicUtils.sendIntent(getActivity(), RoundedImageViewActivity.class); - break; - case "BlurNavigationDrawerActivity": - BasicUtils.sendIntent(getActivity(), BlurNavigationDrawerActivity.class); - break; - case "BlurDialogActivity": - BasicUtils.sendIntent(getActivity(), BlurDialogActivity.class); - break; - case "CustomPullToRefreshActivity": - BasicUtils.sendIntent(getActivity(), CustomPullToRefreshActivity.class); - break; - case "MaterialEditTextActivity": - BasicUtils.sendIntent(getActivity(), MaterialEditTextActivity.class); - break; - case "RippleBackgroundActivity": - BasicUtils.sendIntent(getActivity(), RippleBackgroundActivity.class); - break; - case "PagerSlidingTabStripActivity": - BasicUtils.sendIntent(getActivity(), PagerSlidingTabStripActivity.class); - break; - case "MaterialRippleActivity": - BasicUtils.sendIntent(getActivity(), MaterialRippleActivity.class); - break; - case "CircleProgressActivity": - BasicUtils.sendIntent(getActivity(), CircleProgressActivity.class); - break; - case "MaterialDesignActivity": - BasicUtils.sendIntent(getActivity(), MaterialDesignActivity.class); - break; - case "SwitchAnimationActivity": - BasicUtils.sendIntent(getActivity(), SwitchAnimationActivity.class); - break; - case "RippleDrawableActivity": - BasicUtils.sendIntent(getActivity(), RippleDrawableActivity.class); - break; - case "MaterialProgressWheelActivity": - BasicUtils.sendIntent(getActivity(), MaterialProgressWheelActivity.class); - break; - case "MenuCircleShowingAnimationActivity": - BasicUtils.sendIntent(getActivity(), MenuCircleShowingAnimationActivity.class); - break; - case "SwitchButtonActivity": - BasicUtils.sendIntent(getActivity(), SwitchButtonActivity.class); - break; + landingEnhanceListView + .setSwipeDirection(EnhancedListView.SwipeDirection.START); + landingEnhanceListView + .setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, + int position, long id) { + Intent intent = (Intent) enhanceList.get(position).get("intent"); + startActivity(intent); + // TODO add OnItemClick event + } + }); + } + protected List> getData(String prefix) { + List> myData = new ArrayList>(); - } - } - }); + Intent intent = new Intent("com.marshalchen.common.demoofui", null); + + PackageManager pm = getActivity().getPackageManager(); + List list = pm.queryIntentActivities(intent, 0); + + if (null == list) + return myData; + + int len = list.size(); + for (int i = 0; i < len; i++) { + ResolveInfo info = list.get(i); + String activityName = info.activityInfo.name; + String[] labelPath = activityName.split("\\."); + String nextLabel = labelPath[labelPath.length - 1]; + addItem(myData, + nextLabel, + activityIntent( + info.activityInfo.applicationInfo.packageName, + info.activityInfo.name)); + } + Collections.sort(myData, sDisplayNameComparator); + return myData; } + private final static Comparator> sDisplayNameComparator = new Comparator>() { + private final Collator collator = Collator.getInstance(); + + public int compare(Map map1, Map map2) { + return collator.compare(map1.get("title"), map2.get("title")); + } + }; + + protected Intent activityIntent(String pkg, String componentName) { + Intent result = new Intent(); + result.setClassName(pkg, componentName); + return result; + } + + protected void addItem(List> data, String name, Intent intent) { + Map temp = new HashMap(); + temp.put("title", name); + temp.put("intent", intent); + data.add(temp); + } private void initViewPager() { addLandingViewPager(); - landingMallViewpager.setAdapter(new CustomViewPagerAdapter(viewpagerList)); - landingMallViewpager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { - @Override - public void onPageScrolled(int i, float v, int i2) { + landingMallViewpager.setAdapter(new CustomViewPagerAdapter( + viewpagerList)); + landingMallViewpager + .setOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int i, float v, int i2) { - } + } - @Override - public void onPageSelected(int i) { + @Override + public void onPageSelected(int i) { - } + } - @Override - public void onPageScrollStateChanged(int i) { - //setCurrentDot(i); + @Override + public void onPageScrollStateChanged(int i) { + // setCurrentDot(i); - } - }); - landingMallViewPagerIndicator = (CirclePageIndicator) mainView.findViewById(R.id.landingMallViewPagerIndicator); + } + }); + landingMallViewPagerIndicator = (CirclePageIndicator) mainView + .findViewById(R.id.landingMallViewPagerIndicator); landingMallViewPagerIndicator.setViewPager(landingMallViewpager); -// final float density = getResources().getDisplayMetrics().density; -// landingMallViewPagerIndicator.setBackgroundColor(0xffffff); -// landingMallViewPagerIndicator.setRadius(5 * density); -// landingMallViewPagerIndicator.setPageColor(getResources().getColor(R.color.black)); -// landingMallViewPagerIndicator.setFillColor(getResources().getColor(R.color.white)); -// landingMallViewPagerIndicator.setStrokeColor(getResources().getColor(R.color.black)); -// landingMallViewPagerIndicator.setStrokeWidth(1 * 1.0f); + // final float density = getResources().getDisplayMetrics().density; + // landingMallViewPagerIndicator.setBackgroundColor(0xffffff); + // landingMallViewPagerIndicator.setRadius(5 * density); + // landingMallViewPagerIndicator.setPageColor(getResources().getColor(R.color.black)); + // landingMallViewPagerIndicator.setFillColor(getResources().getColor(R.color.white)); + // landingMallViewPagerIndicator.setStrokeColor(getResources().getColor(R.color.black)); + // landingMallViewPagerIndicator.setStrokeWidth(1 * 1.0f); } - private class EnhancedListAdapter extends BaseAdapter { - //private List mItems = new ArrayList(); - private List> mLists = new ArrayList>(); + // private List mItems = new ArrayList(); + private List> mLists = new ArrayList<>(); - // private EnhancedListAdapter(List mItems) { -// this.mItems = mItems; -// } - private EnhancedListAdapter(List> mLists) { + // private EnhancedListAdapter(List mItems) { + // this.mItems = mItems; + // } + private EnhancedListAdapter(List> mLists) { this.mLists = mLists; } @@ -1253,7 +222,6 @@ public void remove(int position) { notifyDataSetChanged(); } - /** * How many items are in the data set represented by this Adapter. * @@ -1265,10 +233,11 @@ public int getCount() { } /** - * Get the data item associated with the specified position in the data set. + * Get the data item associated with the specified position in the data + * set. * - * @param position Position of the item whose data we want within the adapter's - * data set. + * @param position Position of the item whose data we want within the + * adapter's data set. * @return The data at the specified position. */ @Override @@ -1279,7 +248,8 @@ public Object getItem(int position) { /** * Get the row id associated with the specified position in the list. * - * @param position The position of the item within the adapter's data set whose row id we want. + * @param position The position of the item within the adapter's data set + * whose row id we want. * @return The id of the item at the specified position. */ @Override @@ -1287,50 +257,46 @@ public long getItemId(int position) { return position; } - @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { - convertView = getActivity().getLayoutInflater().inflate(R.layout.list_item_enhance, parent, false); - // Clicking the delete icon, will read the position of the item stored in - // the tag and delete it from the list. So we don't need to generate a new + convertView = getActivity().getLayoutInflater().inflate( + R.layout.list_item_enhance, parent, false); + // Clicking the delete icon, will read the position of the item + // stored in + // the tag and delete it from the list. So we don't need to + // generate a new // onClickListener every time the content of this view changes. final View origView = convertView; - convertView.findViewById(R.id.action_delete).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - // listViewHistory.delete(((ViewHolder) origView.getTag()).position); - } - }); + convertView.findViewById(R.id.action_delete) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // listViewHistory.delete(((ViewHolder) + // origView.getTag()).position); + } + }); holder = new ViewHolder(); assert convertView != null; - holder.mTextView = (TextView) convertView.findViewById(R.id.reacolhistextview); - holder.mTextViewDir = (TextView) convertView.findViewById(R.id.reacolhistextviewDir); - holder.mTextViewDetail = (TextView) convertView.findViewById(R.id.reacolhistextviewDetail); - //holder.reacolReaLyout = (RelativeLayout) convertView.findViewById(R.id.reacolReaLyout); + holder.mTextView = (TextView) convertView + .findViewById(R.id.reacolhistextview); + // holder.reacolReaLyout = (RelativeLayout) + // convertView.findViewById(R.id.reacolReaLyout); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } - holder.position = position; - holder.mTextView.setText(mLists.get(position).get("name")); - holder.mTextViewDir.setText(mLists.get(position).get("detail")); - holder.mTextViewDetail.setText(mLists.get(position).get("subname")); - -// + holder.mTextView.setText(mLists.get(position).get("title") + .toString()); return convertView; } private class ViewHolder { TextView mTextView; - TextView mTextViewDir; - TextView mTextViewDetail; - RelativeLayout reacolReaLyout; - int position; } } @@ -1338,14 +304,15 @@ private class ViewHolder { private void addLandingViewPager() { if (viewpagerList == null) viewpagerList = new ArrayList(); - else viewpagerList.clear(); - LayoutInflater li = LayoutInflater.from(getActivity()); + else + viewpagerList.clear(); for (int i = 0; i < 3; i++) { - View viewPagerItem = getActivity().getLayoutInflater().inflate(R.layout.landing_viewpager_item, - null, false); - ViewPagerViewHolder viewHolder = new ViewPagerViewHolder(viewPagerItem); + View viewPagerItem = getActivity().getLayoutInflater().inflate( + R.layout.landing_viewpager_item, null, false); + ViewPagerViewHolder viewHolder = new ViewPagerViewHolder( + viewPagerItem); viewHolder.landViewPagerImage.setImageResource(R.drawable.test); - // viewHolder.landViewPagerInfo1.setText("hh"+i); + // viewHolder.landViewPagerInfo1.setText("hh"+i); // viewPagerItem.setTag(viewHolder); viewpagerList.add(viewPagerItem); } @@ -1374,7 +341,7 @@ public ViewPagerViewHolder(View view) { class CustomViewPagerAdapter extends PagerAdapter { List viewpagerList; - public CustomViewPagerAdapter(List viewpagerList) { + public CustomViewPagerAdapter(List viewpagerList) { this.viewpagerList = viewpagerList; } @@ -1388,11 +355,11 @@ public boolean isViewFromObject(View view, Object o) { return view == (o); } - @Override public void destroyItem(ViewGroup container, int position, Object object) { -// super.destroyItem(container, position, object); - if (viewpagerList != null && viewpagerList.size() > position && viewpagerList.get(position) != null) + // super.destroyItem(container, position, object); + if (viewpagerList != null && viewpagerList.size() > position + && viewpagerList.get(position) != null) container.removeView(viewpagerList.get(position)); } @@ -1400,15 +367,17 @@ public void destroyItem(ViewGroup container, int position, Object object) { @Override public Object instantiateItem(ViewGroup container, int position) { container.addView(viewpagerList.get(position), 0); - viewpagerList.get(position).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(); - intent.setClass(getActivity(), MaterialActivity.class); - startActivity(intent); - } - }); - // return super.instantiateItem(container, position); + viewpagerList.get(position).setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(); + intent.setClass(getActivity(), + MaterialActivity.class); + startActivity(intent); + } + }); + // return super.instantiateItem(container, position); return viewpagerList.get(position); }