Photo browsing artifact source code sharing

Photo browsing artifact source code sharing

Source code introduction: Share a beautiful picture application, there is nothing you can't see, only what you can't think of.

Source code effect:

Source code snippet:

  1. package cn.linving.girls.activity;
  2.   
  3. import java.util.HashMap;
  4. import java.util.Map;
  5.   
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.support.v4.app.Fragment;
  9. import android.support.v4.app.FragmentTransaction;
  10. import android.support.v4.widget.SlidingPaneLayout;
  11. import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
  12. import android.util.DisplayMetrics;
  13. import android.view.KeyEvent;
  14. import android.view.View;
  15. import android.widget.FrameLayout;
  16. import cn.linving.girls.MyApplication;
  17. import cn.linving.girls.R;
  18. import cn.linving.girls.fragment.AllmeinviFragment;
  19. import cn.linving.girls.fragment.BijiniFragment;
  20. import cn.linving.girls.fragment.ChangTuiFragment;
  21. import cn.linving.girls.fragment.ChangfaFragment;
  22. import cn.linving.girls.fragment.ChemoFragment;
  23. import cn.linving.girls.fragment.CollectFragment;
  24. import cn.linving.girls.fragment.DuanfaFragment;
  25. import cn.linving.girls.fragment.FeizhuliuFragment;
  26. import cn.linving.girls.fragment.GaoyayoufanFragment;
  27. import cn.linving.girls.fragment.GudianmeinvFragment;
  28. import cn.linving.girls.fragment.KeaiFragment;
  29. import cn.linving.girls.fragment.LuoliFragment;
  30. import cn.linving.girls.fragment.MainFragment;
  31. import cn.linving.girls.fragment.MenuFragment;
  32. import cn.linving.girls.fragment.QingchunFragment;
  33. import cn.linving.girls.fragment.QizhiFragment;
  34. import cn.linving.girls.fragment.ShishangFragment;
  35. import cn.linving.girls.fragment.SuyanFragment;
  36. import cn.linving.girls.fragment.TiansuchunFragment;
  37. import cn.linving.girls.fragment.WangluomeinvFragment;
  38. import cn.linving.girls.fragment.WeimeiFragment;
  39. import cn.linving.girls.fragment.XiaoHuaFragment;
  40. import cn.linving.girls.fragment.XiaoQingXinFragment;
  41. import cn.linving.girls.fragment.XiezhenFragment;
  42. import cn.linving.girls.fragment.XingGanFragment;
  43. import cn.linving.girls.fragment.YouhuoFragment;
  44. import cn.linving.girls.fragment.ZuqiubaobeiFragment;
  45.   
  46. import com.umeng.analytics.MobclickAgent;
  47. import com.umeng.update.UmengUpdateAgent;
  48. import com.zdp.aseo.content.AseoZdpAseo;
  49.   
  50. public   class MainActivity extends BaseActivity {
  51. public   final String TAG = "MainActivity" ;
  52. public MenuFragment menuFragment;
  53.   
  54. private SlidingPaneLayout slidingPaneLayout;
  55. private DisplayMetrics displayMetrics = new DisplayMetrics();
  56. private   int maxMargin = 0 ;
  57. private FragmentTransaction transaction;
  58. private MainFragment mainFragment;
  59. public XiaoQingXinFragment xiaoQingXinFragment;
  60. public XingGanFragment xingGanFragment;
  61. public ChangTuiFragment changTuiFragment;
  62. public XiaoHuaFragment xiaoHuaFragment;
  63. public QingchunFragment qingchunFragment;
  64. public XiezhenFragment XiezhenFragment;
  65. public QizhiFragment qizhiFragment;
  66. public ShishangFragment shishangFragment;
  67. public ChangfaFragment changfaFragment;
  68. public DuanfaFragment duanfaFragment;
  69. public GaoyayoufanFragment gaoyayoufanFragment;
  70. public TiansuchunFragment tiansuchunFragment;
  71. public KeaiFragment keaiFragment;
  72. public LuoliFragment luoliFragment;
  73. public WeimeiFragment weimeiFragment;
  74. public SuyanFragment suyanFragment;
  75. public YouhuoFragment youhuoFragment;
  76. public BijiniFragment bijiniFragment;
  77. public ChemoFragment chemoFragment;
  78. public ZuqiubaobeiFragment zuqiubaobeiFragment;
  79. public GudianmeinvFragment gudianmeinvFragment;
  80. public WangluomeinvFragment WangluomeinvFragment;
  81. public FeizhuliuFragment feizhuliuFragment;
  82. public AllmeinviFragment allmeinvFragment;
  83. public CollectFragment collectFragment;
  84. // /  
  85. public   static Map<string, fragment= "" > fragmentMap = new HashMap<string, fragment= "" >();
  86.   
  87. @Override  
  88. protected   void onCreate(Bundle savedInstanceState) {
  89. super .onCreate(savedInstanceState);
  90. MyApplication.addActivity( this );
  91. getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
  92. setContentView(R.layout.activity_main);
  93. initData();
  94. initView();
  95. initSDK();
  96. }
  97.   
  98. private   void initSDK() {
  99. //SpotManager.getInstance(this).cacheNextAd();  
  100. //SpotManager.getInstance(this).asyncLoadNextSplash();  
  101. /**
  102. *
  103. * Umeng
  104. *
  105. *
  106. */  
  107. UmengUpdateAgent.update( this );
  108. // When the SDK counts Fragments, it needs to close the page statistics that come with the Activity.  
  109. // Then reintegrate the page statistics code into each page (including the Activities that call onResume and onPause).  
  110. MobclickAgent.openActivityDurationTrack( false );
  111. // MobclickAgent.setAutoLocation(true);  
  112. // MobclickAgent.setSessionContinueMillis(1000);  
  113. MobclickAgent.updateOnlineConfig( this );
  114. }
  115.   
  116. private   void initView() {
  117. slidingPaneLayout = (SlidingPaneLayout) findViewById(R.id.slidingpanellayout);
  118. menuFragment = new MenuFragment();
  119. transaction = getSupportFragmentManager().beginTransaction();
  120.   
  121. transaction.replace(R.id.slidingpane_menu, menuFragment);
  122. transaction.replace(R.id.slidingpane_content, mainFragment);
  123. transaction.commit();
  124. maxMargin = displayMetrics.heightPixels / 10 ;
  125. slidingPaneLayout.setPanelSlideListener( new PanelSlideListener() {
  126. @Override  
  127. public   void onPanelSlide(View panel, float slideOffset) {
  128. int contentMargin = ( int ) (slideOffset * maxMargin);
  129.   
  130. FrameLayout.LayoutParams contentParams = mainFragment
  131. .getCurrentViewParams();
  132. contentParams.setMargins( 0 , contentMargin, 0 , contentMargin);
  133.   
  134. mainFragment.setCurrentViewPararms(contentParams);
  135.   
  136. float scale = 1 - (( 1 - slideOffset) * maxMargin * 3 )
  137. / ( float ) displayMetrics.heightPixels;
  138. menuFragment.getCurrentView().setScaleX(scale); //Set the scaling reference point  
  139. menuFragment.getCurrentView().setScaleY(scale); // Set the scaling reference point  
  140. menuFragment.getCurrentView().setPivotX( 0 ); // Set the zoom and selection point  
  141. menuFragment.getCurrentView().setPivotY(
  142. displayMetrics.heightPixels / 2 );
  143. menuFragment.getCurrentView().setAlpha(slideOffset);
  144. }
  145.   
  146. @Override  
  147. public   void onPanelOpened(View arg0) {
  148. }
  149.   
  150. @Override  
  151. public   void onPanelClosed(View arg0) {
  152. }
  153. });
  154. }
  155.   
  156. private   void initData() {
  157. mainFragment = new MainFragment();
  158. xiaoQingXinFragment = new XiaoQingXinFragment(XiaoQingXinFragment.TAG);
  159. xingGanFragment = new XingGanFragment(XingGanFragment.TAG);
  160. changTuiFragment = new ChangTuiFragment(ChangTuiFragment.TAG);
  161. xiaoHuaFragment = new XiaoHuaFragment(XiaoHuaFragment.TAG);
  162. qingchunFragment = new QingchunFragment(QingchunFragment.TAG);
  163. xiezhenFragment = new XiezhenFragment(XiezhenFragment.TAG);
  164. qizhiFragment = new QizhiFragment(QizhiFragment.TAG);
  165. shishangFragment = new ShishangFragment(ShishangFragment.TAG);
  166. changfaFragment = new ChangfaFragment(ChangfaFragment.TAG);
  167. duanfaFragment = new DuanfaFragment(DuanfaFragment.TAG);
  168. gaoyayoufanFragment = new GaoyayoufanFragment(GaoyayoufanFragment.TAG);
  169. tiansuchunFragment = new TiansuchunFragment(TiansuchunFragment.TAG);
  170. keaiFragment = new KeaiFragment(KeaiFragment.TAG);
  171. luoliFragment = new LuoliFragment(LuoliFragment.TAG);
  172. weimeiFragment = new WeimeiFragment(WeimeiFragment.TAG);
  173. suyanFragment = new SuyanFragment(SuyanFragment.TAG);
  174. youhuoFragment = new YouhuoFragment(YouhuoFragment.TAG);
  175. bijiniFragment = new BijiniFragment(BijiniFragment.TAG);
  176. chemoFragment = new ChemoFragment(ChemoFragment.TAG);
  177. zuqiubaobeiFragment = new ZuqiubaobeiFragment(ZuqiubaobeiFragment.TAG);
  178. gudianmeinvFragment = new GudianmeinvFragment(GudianmeinvFragment.TAG);
  179. wangluomeinvFragment = new WangluomeinvFragment(
  180. WangluomeinvFragment.TAG);
  181. feizhuliuFragment = new FeizhuliuFragment(FeizhuliuFragment.TAG);
  182. allmeinvFragment = new AllmeinviFragment(AllmeinviFragment.TAG);
  183. collectFragment = new CollectFragment();
  184. AseoZdpAseo.initFinalTimer( this , AseoZdpAseo.BOTH_TYPE);
  185. //  
  186. fragmentMap.put(MainFragment.TAG, mainFragment);
  187. fragmentMap.put(XiaoQingXinFragment.TAG, xiaoQingXinFragment);
  188. fragmentMap.put(XingGanFragment.TAG, xingGanFragment);
  189. fragmentMap.put(ChangTuiFragment.TAG, changTuiFragment);
  190. fragmentMap.put(XiaoHuaFragment.TAG, xiaoHuaFragment);
  191. fragmentMap.put(QingchunFragment.TAG, qingchunFragment);
  192. fragmentMap.put(XiezhenFragment.TAG, xiezhenFragment);
  193. fragmentMap.put(QizhiFragment.TAG, qizhiFragment);
  194. fragmentMap.put(ShishangFragment.TAG, shishangFragment);
  195. fragmentMap.put(ChangfaFragment.TAG, changfaFragment);
  196. fragmentMap.put(DuanfaFragment.TAG, duanfaFragment);
  197. fragmentMap.put(GaoyayoufanFragment.TAG, gaoyayoufanFragment);
  198. fragmentMap.put(TiansuchunFragment.TAG, tiansuchunFragment);
  199. fragmentMap.put(KeaiFragment.TAG, keaiFragment);
  200. fragmentMap.put(LuoliFragment.TAG, luoliFragment);
  201. fragmentMap.put(WeimeiFragment.TAG, weimeiFragment);
  202. fragmentMap.put(SuyanFragment.TAG, suyanFragment);
  203. fragmentMap.put(YouhuoFragment.TAG, youhuoFragment);
  204. fragmentMap.put(BijiniFragment.TAG, bijiniFragment);
  205. fragmentMap.put(ChemoFragment.TAG, chemoFragment);
  206. fragmentMap.put(ZuqiubaobeiFragment.TAG, zuqiubaobeiFragment);
  207. fragmentMap.put(GudianmeinvFragment.TAG, gudianmeinvFragment);
  208. fragmentMap.put(WangluomeinvFragment.TAG, wangluomeinvFragment);
  209. fragmentMap.put(FeizhuliuFragment.TAG, feizhuliuFragment);
  210. fragmentMap.put(AllmeinviFragment.TAG, allmeinvFragment);
  211. fragmentMap.put(CollectFragment.TAG, collectFragment);
  212. //  
  213.   
  214. }
  215.   
  216. /**
  217. * @return the slidingPaneLayout
  218. */  
  219. public SlidingPaneLayout getSlidingPaneLayout() {
  220. return slidingPaneLayout;
  221. }
  222.   
  223. @Override  
  224. protected   void onPause() {
  225. MobclickAgent.onPageEnd(TAG);
  226. MobclickAgent.onPause( this );
  227. super .onPause();
  228. }
  229.   
  230. @Override  
  231. protected   void onResume() {
  232. MobclickAgent.onPageStart(TAG);
  233. MobclickAgent.onResume( this );
  234. super .onResume();
  235. }
  236.   
  237. // Return key listener  
  238. @Override  
  239. public   boolean onKeyUp( int keyCode, KeyEvent event) {
  240. if (keyCode == KeyEvent.KEYCODE_BACK) {
  241.   
  242. if (slidingPaneLayout.isOpen()) {
  243. slidingPaneLayout.closePane();
  244. } else {
  245. // slidingPaneLayout.openPane();  
  246. transaction = getSupportFragmentManager().beginTransaction();
  247. transaction.setCustomAnimations(R.anim.push_right_in,
  248. R.anim.push_right_out);
  249. transaction.replace(R.id.slidingpane_content, mainFragment);
  250. transaction.commit();
  251. }
  252. }
  253. return   true ;
  254. }
  255.   
  256. @Override  
  257. protected   void onDestroy() {
  258. super .onDestroy();
  259. }
  260.       
  261. @Override  
  262. public   void onBackPressed()
  263. {
  264. Intent intent = new Intent(Intent.ACTION_MAIN);
  265. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  266. intent.addCategory(Intent.CATEGORY_HOME);
  267. startActivity(intent);
  268. }
  269. }</string,></string,>

Download address: http://download..com/data/2096564

<<:  Bluetooth 4.0 BLE Development

>>:  Entrepreneurs, you may just be a house in the Third Ring Road in the eyes of investors

Recommend

The game of advertising space allocation in search bidding promotion

People in the industry all know something about t...

Product Operation: How to build a closed loop of content ecology?

Have you ever had this experience: you just start...

One Year Notes for iOS Programmers - Learning

[[140168]] Text/Some Bird Preface Before I knew i...

Pricing and product selection thinking for live streaming sales!

“Is it feasible to start by selling cheap product...

30-day travel English: Break down the dumb English

Most Chinese people will encounter many embarrass...

2019 Home Improvement Industry Information Flow Advertising Optimization Case!

This article shares with you a case study on info...

Which specific reports should I look at to analyze Baidu bidding account data?

Recently, I have often come into contact with som...

Top 10 Mobile App Development Trends in 2023

1. Leverage cloud-based services As trends emerge...

Valuation Modeling Skills Enhancement Course (Fifth Edition)

Resource introduction of Valuation Modeling Skill...

How to release a trial version of a WeChat mini program?

Q: How to release the WeChat Mini Program trial v...