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: - package com.anjoyo.anjoyosafetymain;
-
- import java.util.ArrayList;
- import java.util.List;
-
- import android.content.Intent;
- import android.support.v4.view.ViewPager;
- import android.support.v4.view.ViewPager.OnPageChangeListener;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.view.animation.Animation;
- import android.view.animation.Animation.AnimationListener;
- import android.view.animation.AnimationUtils;
- import android.widget.AdapterView;
- import android.widget.AdapterView.OnItemClickListener;
- import android.widget.ImageView;
- import android.widget.TextView;
- import android.widget.Toast;
-
- import com.anjoyo.anjoyosafety.activity.Battery;
- import com.anjoyo.anjoyosafety.activity.CrankSmsAndCall;
- import com.anjoyo.anjoyosafety.adapter.MainGridViewAdapter1;
- import com.anjoyo.anjoyosafety.adapter.MainGridViewAdapter2;
- import com.anjoyo.anjoyosafety.adapter.MyViewPage;
- import com.anjoyo.anjoyosafety.base.MyBaseActivity;
- import com.anjoyo.anjoyosafety.custom.DragGrid1;
- import com.anjoyo.anjoyosafety.custom.DragGrid2;
- import com.anjoyo.anjoyosatety.activity.R;
- import com.slidingmenu.lib.SlidingMenu;
- import com.slidingmenu.lib.SlidingMenu.OnCloseListener;
- import com.zdp.aseo.content.AseoZdpAseo;
-
- public class MainActivity extends MyBaseActivity implements
- OnItemClickListener, OnClickListener, OnPageChangeListener {
- private ViewPager viewpager;
- MyViewPage viewPagerAdt;
- private View view1;
- private View view2;
- private List<view> listvp;
- private DragGrid1 gridview1;
- private DragGrid2 gridview2;
- private MainGridViewAdapter1 gridviewAdt1;
- private MainGridViewAdapter2 gridviewAdt2;
- private TextView tv;
- private ImageView act_main_option, act_main_pagenum;
- private SlidingMenu slidingMenu;
- private View act_main_zhedang;
- private boolean isFrist = true ;
-
- @Override
- protected void setContentView() {
- setContentView(R.layout.main);
- }
-
- @Override
- protected void findViewById() {
- viewpager = (ViewPager) findViewById(R.id.act_main_viewpager);
- act_main_option = (ImageView) findViewById(R.id.act_main_option);
- act_main_pagenum = (ImageView) findViewById(R.id.act_main_pagenum);
- act_main_pagenum.setOnClickListener( this );
- act_main_zhedang = (View) findViewById(R.id.act_main_zhedang);
-
- }
-
- @Override
- protected void controll() {
- AseoZdpAseo.init( this ,AseoZdpAseo.INSERT_TYPE);
- view1 = LayoutInflater.from( this ).inflate(R.layout.first_main_gridview,
- null );
- view2 = LayoutInflater.from( this ).inflate(
- R.layout.second_main_gridview, null );
- gridview1 = (DragGrid1) view1.findViewById(R.id.first_main_gridview);
- gridview2 = (DragGrid2) view2.findViewById(R.id.second_main_gridview);
- listvp = new ArrayList<view>();
-
- gridviewAdt1 = new MainGridViewAdapter1( this );
- gridviewAdt2 = new MainGridViewAdapter2( this );
- gridview1.setAdapter(gridviewAdt1);
- gridview2.setAdapter(gridviewAdt2);
-
- listvp.add(view1);
- listvp.add(view2);
- viewPagerAdt = new MyViewPage(listvp);
- viewpager.setAdapter(viewPagerAdt);
-
-
- gridview1.setOnItemClickListener( this );
- gridview2.setOnItemClickListener( this );
- initSlidingMenu();
- act_main_option.setOnClickListener( this );
- viewpager.setOnPageChangeListener( this );
-
- }
-
- @Override
- public void onItemClick(AdapterView<!--?--> arg0, View arg1, int arg2, long arg3) {
-
- tv = (TextView) arg1.findViewById(R.id.main_gridview_item_name);
- String text = tv.getText().toString();
- final Intent intent = new Intent();
- if (text.equals( "Phone Cleanup" )) {
- intent.setClass( MainActivity.this ,
- com.anjoyo.anjoyosafety.activity.ClearAct. class );
- startActivity(intent);
- } else if (text.equals( "Traffic Monitoring" )) {
- intent.setClass( MainActivity.this ,
- com.anjoyo.anjoyosafety.activity.FlowMainAct. class );
- startActivity(intent);
- } else if (text.equals( "harassment interception" )) {
- intent.setClass(MainActivity. this , CrankSmsAndCall. class );
- startActivity(intent);
- }
- else if (text.equals( "Mobile phone physical examination" )) {
- Toast.makeText( this , "Mobile phone physical examination" , 0 ).show();
- } else if (text.equals( "Privacy Behavior Monitoring" )) {
- Toast.makeText( this , "Privacy Behavior Monitoring" , 0 ).show();
- } else if (text.equals( "Address Book Backup" )) {
- Toast.makeText( this , "Address Book Backup" , 0 ).show();
- } else if (text.equals( "Mobile phone anti-theft" )) {
- Toast.makeText( this , "Mobile phone anti-theft" , 0 ).show();
- } else if (text.equals( "Security Market" )) {
- Toast.makeText( this , "Safe Market" , 0 ).show();
- } else if (text.equals( "Application Tools" )) {
- Toast.makeText( this , "Application Tools" , 0 ).show();
- }
- else if (text.equals( "privacy space" )) {
- intent.setClass( this ,
- com.anjoyo.anjoyosafety.activity.PersonalSpaceSettingPwdActivity. class );
- startActivity(intent);
- } else if (text.equals( "Mobile Antivirus" )) {
- Toast.makeText( this , "Mobile Antivirus" , 0 ).show();
- } else if (text.equals( "Power Saving Management" )) {
- intent.setClass(MainActivity. this , Battery. class );
- startActivity(intent);
- } else if (text.equals( "手机管家" )) {
- Toast.makeText( this , "手机管家" , 0 ).show();
- } else if (text.equals( "Secure QR Code" )) {
- intent.setClass( MainActivity.this ,
- com.anjoyo.anjoyosafety.activity.CodeMainActivity. class );
- startActivity(intent);
- } else if (text.equals( "Malicious ad blocking" )) {
- intent.setClass( MainActivity.this ,
- com.anjoyo.anjoyosafety.activity.FindActivity. class );
- startActivity(intent);
- }
-
-
- }
-
-
- private void initSlidingMenu() {
- slidingMenu = new SlidingMenu( this );
- slidingMenu.setMode(SlidingMenu.RIGHT);
- slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
- slidingMenu.setBehindWidth( 120 );
- slidingMenu.setFadeDegree( 0.35f );
- slidingMenu.attachToActivity( this , SlidingMenu.SLIDING_CONTENT);
- slidingMenu.setMenu(R.layout.main_slidingmenu);
- }
-
- @Override
- public void onClick(View v) {
-
- switch (v.getId()) {
-
- case R.id.act_main_option:
- slidingMenu.showMenu();
- act_main_zhedang.setVisibility(View.VISIBLE);
- act_main_option.setBackgroundDrawable(getResources().getDrawable(
- R.drawable.main_menu_negative_normal));
-
- slidingMenu.setOnCloseListener( new OnCloseListener() {
- @Override
- public void onClose() {
- act_main_zhedang.setVisibility(View.GONE);
-
- act_main_option.setBackgroundDrawable(getResources()
- .getDrawable(R.drawable.main_menu_normal));
-
- }
- });
-
- break ;
- case R.id.act_main_pagenum:
- if (viewpager.getCurrentItem() == 0 ) {
- viewpager.setCurrentItem( 1 );
- } else {
- viewpager.setCurrentItem( 0 );
- }
- break ;
- }
- }
-
- private void setpage() {
- Animation animation = AnimationUtils
- .loadAnimation( this , R.anim.page_in);
- animation.setAnimationListener( new AnimationListener() {
-
- @Override
- public void onAnimationStart(Animation animation) {
-
-
- }
-
- @Override
- public void onAnimationRepeat(Animation animation) {
-
-
- }
-
- @Override
- public void onAnimationEnd(Animation animation) {
- int i = viewpager.getCurrentItem();
- if (i == 0 ) {
- act_main_pagenum
- .setBackgroundResource(R.drawable.main_page_one);
- } else {
- act_main_pagenum
- .setBackgroundResource(R.drawable.main_page_two);
- }
- Animation animation2 = AnimationUtils.loadAnimation(
- MainActivity. this , R.anim.page_to);
- act_main_pagenum.startAnimation(animation2);
-
- }
- });
- act_main_pagenum.startAnimation(animation);
- }
-
- @Override
- public void onPageScrollStateChanged( int arg0) {
-
-
- }
-
- @Override
- public void onPageScrolled( int arg0, float arg1, int arg2) {
-
-
- }
-
- @Override
- public void onPageSelected( int arg0) {
- setpage();
-
- }
-
- }</view></view>
Download address: http://download..com/data/2089510 |