use of com.sakebook.android.library.reachability.Reachability in project Reachability by sakebook.
the class CustomAnimationActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_animation);
ImageView view = new ImageView(this);
view.setBackgroundResource(R.drawable.custom_button_selector);
view.setScaleType(ImageView.ScaleType.CENTER);
mReachability = new Reachability(this);
mReachability.canTouchableBackView(true);
mReachability.setBackImageResource(R.drawable.tiles);
// Should call before makeHoverView!
mReachability.setHoverView(view, android.R.drawable.ic_partial_secure, android.R.drawable.ic_secure);
mReachability.makeHoverView(Reachability.Position.CENTER);
mReachability.setCustomSlideInAnimation(1000, new AnticipateOvershootInterpolator(), fromLeftAnimation());
mReachability.setCustomSlideOutAnimation(1000, new AnticipateOvershootInterpolator(), toRightAnimation());
findViewById(R.id.switch_hover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchHover();
}
});
}
use of com.sakebook.android.library.reachability.Reachability in project Reachability by sakebook.
the class MyActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mReachability = new Reachability(this);
mReachability.setBackImageResource(R.drawable.tiles);
mReachability.canTouchableBackView(true);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchBack();
}
});
findViewById(R.id.fragment).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MyActivity.this, DrawerActivity.class);
startActivity(intent);
}
});
findViewById(R.id.hover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MyActivity.this, BackandHoverActivity.class);
startActivity(intent);
}
});
findViewById(R.id.animation).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MyActivity.this, CustomAnimationActivity.class);
startActivity(intent);
}
});
}
use of com.sakebook.android.library.reachability.Reachability in project Reachability by sakebook.
the class BackandHoverActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_back_and_hover);
mReachability = new Reachability(this);
mReachability.makeHoverView(Reachability.Position.RIGHT);
findViewById(R.id.switch_hover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchHover();
}
});
findViewById(R.id.switch_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchBack();
}
});
}
use of com.sakebook.android.library.reachability.Reachability in project Reachability by sakebook.
the class NavigationDrawerFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Read in the flag indicating whether or not the user has demonstrated awareness of the
// drawer. See PREF_USER_LEARNED_DRAWER for details.
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);
if (savedInstanceState != null) {
mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION);
mFromSavedInstanceState = true;
}
mReachability = new Reachability(getActivity());
mReachability.makeHoverView(Reachability.Position.LEFT);
mReachability.setBackColor(Color.BLACK);
mReachability.canTouchableBackView(false);
// Select either the default item (0) or the last selected item.
selectItem(mCurrentSelectedPosition);
}
Aggregations