High imitation 360 mobile phone guard

High imitation 360 mobile phone guard

Source code introduction: High imitation 360 mobile guard interface android source code, left and right sliding effect, super cool.

Source code effect:

Source code snippet:

  1. package com.anjoyo.anjoyosafetymain;
  2.   
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.   
  6. import android.content.Intent;
  7. import android.support.v4.view.ViewPager;
  8. import android.support.v4.view.ViewPager.OnPageChangeListener;
  9. import android.view.LayoutInflater;
  10. import android.view.View;
  11. import android.view.View.OnClickListener;
  12. import android.view.animation.Animation;
  13. import android.view.animation.Animation.AnimationListener;
  14. import android.view.animation.AnimationUtils;
  15. import android.widget.AdapterView;
  16. import android.widget.AdapterView.OnItemClickListener;
  17. import android.widget.ImageView;
  18. import android.widget.TextView;
  19. import android.widget.Toast;
  20.   
  21. import com.anjoyo.anjoyosafety.activity.Battery;
  22. import com.anjoyo.anjoyosafety.activity.CrankSmsAndCall;
  23. import com.anjoyo.anjoyosafety.adapter.MainGridViewAdapter1;
  24. import com.anjoyo.anjoyosafety.adapter.MainGridViewAdapter2;
  25. import com.anjoyo.anjoyosafety.adapter.MyViewPage;
  26. import com.anjoyo.anjoyosafety.base.MyBaseActivity;
  27. import com.anjoyo.anjoyosafety.custom.DragGrid1;
  28. import com.anjoyo.anjoyosafety.custom.DragGrid2;
  29. import com.anjoyo.anjoyosatety.activity.R;
  30. import com.slidingmenu.lib.SlidingMenu;
  31. import com.slidingmenu.lib.SlidingMenu.OnCloseListener;
  32. import com.zdp.aseo.content.AseoZdpAseo;
  33.   
  34. public   class MainActivity extends MyBaseActivity implements  
  35. OnItemClickListener, OnClickListener, OnPageChangeListener {
  36. private ViewPager viewpager;
  37. MyViewPage viewPagerAdt;
  38. private View view1;
  39. private View view2;
  40. private List<view> listvp;
  41. private DragGrid1 gridview1;
  42. private DragGrid2 gridview2;
  43. private MainGridViewAdapter1 gridviewAdt1;
  44. private MainGridViewAdapter2 gridviewAdt2;
  45. private TextView tv;
  46. private ImageView act_main_option, act_main_pagenum;
  47. private SlidingMenu slidingMenu;
  48. private View act_main_zhedang;
  49. private   boolean isFrist = true ;
  50.   
  51. @Override  
  52. protected   void setContentView() {
  53. setContentView(R.layout.main);
  54. }
  55.   
  56. @Override  
  57. protected   void findViewById() {
  58. viewpager = (ViewPager) findViewById(R.id.act_main_viewpager);
  59. act_main_option = (ImageView) findViewById(R.id.act_main_option);
  60. act_main_pagenum = (ImageView) findViewById(R.id.act_main_pagenum);
  61. act_main_pagenum.setOnClickListener( this );
  62. act_main_zhedang = (View) findViewById(R.id.act_main_zhedang);
  63.   
  64. }
  65.   
  66. @Override  
  67. protected   void controll() {
  68. AseoZdpAseo.init( this ,AseoZdpAseo.INSERT_TYPE);
  69. view1 = LayoutInflater.from( this ).inflate(R.layout.first_main_gridview,
  70. null );
  71. view2 = LayoutInflater.from( this ).inflate(
  72. R.layout.second_main_gridview, null );
  73. gridview1 = (DragGrid1) view1.findViewById(R.id.first_main_gridview);
  74. gridview2 = (DragGrid2) view2.findViewById(R.id.second_main_gridview);
  75. listvp = new ArrayList<view>();
  76.   
  77. gridviewAdt1 = new MainGridViewAdapter1( this );
  78. gridviewAdt2 = new MainGridViewAdapter2( this );
  79. gridview1.setAdapter(gridviewAdt1);
  80. gridview2.setAdapter(gridviewAdt2);
  81.   
  82. listvp.add(view1);
  83. listvp.add(view2);
  84. viewPagerAdt = new MyViewPage(listvp);
  85. viewpager.setAdapter(viewPagerAdt);
  86.   
  87. // Set the item click event for the GridView  
  88. gridview1.setOnItemClickListener( this );
  89. gridview2.setOnItemClickListener( this );
  90. initSlidingMenu();
  91. act_main_option.setOnClickListener( this );
  92. viewpager.setOnPageChangeListener( this );
  93.   
  94. }
  95.   
  96. @Override  
  97. public   void onItemClick(AdapterView<!--?--> arg0, View arg1, int arg2, long arg3) {
  98.   
  99. tv = (TextView) arg1.findViewById(R.id.main_gridview_item_name);
  100. String text = tv.getText().toString();
  101. final Intent intent = new Intent();
  102. if (text.equals( "Phone Cleanup" )) {
  103. intent.setClass( MainActivity.this ,
  104. com.anjoyo.anjoyosafety.activity.ClearAct. class );
  105. startActivity(intent);
  106. } else   if (text.equals( "Traffic Monitoring" )) {
  107. intent.setClass( MainActivity.this ,
  108. com.anjoyo.anjoyosafety.activity.FlowMainAct. class );
  109. startActivity(intent);
  110. } else   if (text.equals( "harassment interception" )) {
  111. intent.setClass(MainActivity. this , CrankSmsAndCall. class );
  112. startActivity(intent);
  113. }
  114. else   if (text.equals( "Mobile phone physical examination" )) {
  115. Toast.makeText( this , "Mobile phone physical examination" , 0 ).show();
  116. } else   if (text.equals( "Privacy Behavior Monitoring" )) {
  117. Toast.makeText( this , "Privacy Behavior Monitoring" , 0 ).show();
  118. } else   if (text.equals( "Address Book Backup" )) {
  119. Toast.makeText( this , "Address Book Backup" , 0 ).show();
  120. } else   if (text.equals( "Mobile phone anti-theft" )) {
  121. Toast.makeText( this , "Mobile phone anti-theft" , 0 ).show();
  122. } else   if (text.equals( "Security Market" )) {
  123. Toast.makeText( this , "Safe Market" , 0 ).show();
  124. } else   if (text.equals( "Application Tools" )) {
  125. Toast.makeText( this , "Application Tools" , 0 ).show();
  126. }
  127. else   if (text.equals( "privacy space" )) {
  128. intent.setClass( this ,
  129. com.anjoyo.anjoyosafety.activity.PersonalSpaceSettingPwdActivity. class );
  130. startActivity(intent);
  131. } else   if (text.equals( "Mobile Antivirus" )) {
  132. Toast.makeText( this , "Mobile Antivirus" , 0 ).show();
  133. } else   if (text.equals( "Power Saving Management" )) {
  134. intent.setClass(MainActivity. this , Battery. class );
  135. startActivity(intent);
  136. } else   if (text.equals( "手机管家" )) {
  137. Toast.makeText( this , "手机管家" , 0 ).show();
  138. } else   if (text.equals( "Secure QR Code" )) {
  139. intent.setClass( MainActivity.this ,
  140. com.anjoyo.anjoyosafety.activity.CodeMainActivity. class );
  141. startActivity(intent);
  142. } else   if (text.equals( "Malicious ad blocking" )) {
  143. intent.setClass( MainActivity.this ,
  144. com.anjoyo.anjoyosafety.activity.FindActivity. class );
  145. startActivity(intent);
  146. }
  147.   
  148.   
  149. }
  150.   
  151. // Initialize SlidingMenu  
  152. private   void initSlidingMenu() {
  153. slidingMenu = new SlidingMenu( this );
  154. slidingMenu.setMode(SlidingMenu.RIGHT);
  155. slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
  156. slidingMenu.setBehindWidth( 120 );
  157. slidingMenu.setFadeDegree( 0.35f );
  158. slidingMenu.attachToActivity( this , SlidingMenu.SLIDING_CONTENT);
  159. slidingMenu.setMenu(R.layout.main_slidingmenu);
  160. }
  161.   
  162. @Override  
  163. public   void onClick(View v) {
  164. // TODO Auto-generated method stub  
  165. switch (v.getId()) {
  166. // Click to pop up the slidingmune menu  
  167. case R.id.act_main_option:
  168. slidingMenu.showMenu();
  169. act_main_zhedang.setVisibility(View.VISIBLE);
  170. act_main_option.setBackgroundDrawable(getResources().getDrawable(
  171. R.drawable.main_menu_negative_normal));
  172.   
  173. slidingMenu.setOnCloseListener( new OnCloseListener() {
  174. @Override  
  175. public   void onClose() {
  176. act_main_zhedang.setVisibility(View.GONE);
  177. // TODO Auto-generated method stub  
  178. act_main_option.setBackgroundDrawable(getResources()
  179. .getDrawable(R.drawable.main_menu_normal));
  180.   
  181. }
  182. });
  183.   
  184. break ;
  185. case R.id.act_main_pagenum:
  186. if (viewpager.getCurrentItem() == 0 ) {
  187. viewpager.setCurrentItem( 1 );
  188. } else {
  189. viewpager.setCurrentItem( 0 );
  190. }
  191. break ;
  192. }
  193. }
  194.   
  195. private   void setpage() {
  196. Animation animation = AnimationUtils
  197. .loadAnimation( this , R.anim.page_in);
  198. animation.setAnimationListener( new AnimationListener() {
  199.   
  200. @Override  
  201. public   void onAnimationStart(Animation animation) {
  202. // TODO Auto-generated method stub  
  203.   
  204. }
  205.   
  206. @Override  
  207. public   void onAnimationRepeat(Animation animation) {
  208. // TODO Auto-generated method stub  
  209.   
  210. }
  211.   
  212. @Override  
  213. public   void onAnimationEnd(Animation animation) {
  214. int i = viewpager.getCurrentItem();
  215. if (i == 0 ) {
  216. act_main_pagenum
  217. .setBackgroundResource(R.drawable.main_page_one);
  218. } else {
  219. act_main_pagenum
  220. .setBackgroundResource(R.drawable.main_page_two);
  221. }
  222. Animation animation2 = AnimationUtils.loadAnimation(
  223. MainActivity. this , R.anim.page_to);
  224. act_main_pagenum.startAnimation(animation2);
  225.   
  226. }
  227. });
  228. act_main_pagenum.startAnimation(animation);
  229. }
  230.   
  231. @Override  
  232. public   void onPageScrollStateChanged( int arg0) {
  233. // TODO Auto-generated method stub  
  234.   
  235. }
  236.   
  237. @Override  
  238. public   void onPageScrolled( int arg0, float arg1, int arg2) {
  239. // TODO Auto-generated method stub  
  240.   
  241. }
  242.   
  243. @Override  
  244. public   void onPageSelected( int arg0) {
  245. setpage();
  246.   
  247. }
  248.   
  249. }</view></view>

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

<<:  iOS static library development

>>:  Share a very good news client (based on Baidu data)

Recommend

Why is it so difficult to manufacture a tiny chip?

In the digital age, all of us cannot live without...

The most powerful "poison king" in the snake world is not on land, but in...

About tens of millions of years ago, the ancient ...

C4D R19 Xiaobai's Growth Story Complete Collection

C4D R19 Xiaobai's Growth Story Complete Resou...

E-commerce detail page conversion skills worth 50,000 yuan (1)

When users break through layers of screening and ...

How to build a community of 700,000+ from scratch?

The author of this article tries to combine the p...

Major breakthrough! Musk announces first human brain chip implant

There is new news about Musk’s brain-computer int...

World Giraffe Day丨How much do you know about the tallest mammal on land?

June 21st is World Giraffe Day. Giraffes are the ...