Android Open Source - ExampleApp Slide Drawable From Project Back to project page ExampleApp .
License The source code is released under:
Copyright (c) 2014, Altinn
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redis...
If you think the Android project ExampleApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package net.simonvt.menudrawer;
/ * w w w . j a v a 2 s . c o m * /
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
public class SlideDrawable extends Drawable implements Drawable.Callback {
private Drawable mWrapped;
private float mOffset;
private final Rect mTmpRect = new Rect();
public SlideDrawable(Drawable wrapped) {
mWrapped = wrapped;
}
public void setOffset(float offset) {
mOffset = offset;
invalidateSelf();
}
public float getOffset() {
return mOffset;
}
@Override
public void draw(Canvas canvas) {
mWrapped.copyBounds(mTmpRect);
canvas.save();
canvas.translate(1.f / 3 * mTmpRect.width() * -mOffset, 0);
mWrapped.draw(canvas);
canvas.restore();
}
@Override
public void setChangingConfigurations(int configs) {
mWrapped.setChangingConfigurations(configs);
}
@Override
public int getChangingConfigurations() {
return mWrapped.getChangingConfigurations();
}
@Override
public void setDither(boolean dither) {
mWrapped.setDither(dither);
}
@Override
public void setFilterBitmap(boolean filter) {
mWrapped.setFilterBitmap(filter);
}
@Override
public void setAlpha(int alpha) {
mWrapped.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter cf) {
mWrapped.setColorFilter(cf);
}
@Override
public void setColorFilter(int color, PorterDuff.Mode mode) {
mWrapped.setColorFilter(color, mode);
}
@Override
public void clearColorFilter() {
mWrapped.clearColorFilter();
}
@Override
public boolean isStateful() {
return mWrapped.isStateful();
}
@Override
public boolean setState(int [] stateSet) {
return mWrapped.setState(stateSet);
}
@Override
public int [] getState() {
return mWrapped.getState();
}
@Override
public Drawable getCurrent() {
return mWrapped.getCurrent();
}
@Override
public boolean setVisible(boolean visible, boolean restart) {
return super.setVisible(visible, restart);
}
@Override
public int getOpacity() {
return mWrapped.getOpacity();
}
@Override
public Region getTransparentRegion() {
return mWrapped.getTransparentRegion();
}
@Override
protected boolean onStateChange(int [] state) {
mWrapped.setState(state);
return super.onStateChange(state);
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
mWrapped.setBounds(bounds);
}
@Override
public int getIntrinsicWidth() {
return mWrapped.getIntrinsicWidth();
}
@Override
public int getIntrinsicHeight() {
return mWrapped.getIntrinsicHeight();
}
@Override
public int getMinimumWidth() {
return mWrapped.getMinimumWidth();
}
@Override
public int getMinimumHeight() {
return mWrapped.getMinimumHeight();
}
@Override
public boolean getPadding(Rect padding) {
return mWrapped.getPadding(padding);
}
@Override
public ConstantState getConstantState() {
return super.getConstantState();
}
@Override
public void invalidateDrawable(Drawable who) {
if (who == mWrapped) {
invalidateSelf();
}
}
@Override
public void scheduleDrawable(Drawable who, Runnable what, long when) {
if (who == mWrapped) {
scheduleSelf(what, when);
}
}
@Override
public void unscheduleDrawable(Drawable who, Runnable what) {
if (who == mWrapped) {
unscheduleSelf(what);
}
}
}
Java Source Code List com.altinn.apps.fisher.AppContext.java com.altinn.apps.fisher.CacheManager.java com.altinn.apps.fisher.common.AppConstants.java com.altinn.apps.fisher.common.IStatusMessage.java com.altinn.apps.fisher.common.MenuItem.java com.altinn.apps.fisher.common.StatusMessage.java com.altinn.apps.fisher.db.DataBaseHelper.java com.altinn.apps.fisher.db.FactoryDBHelper.java com.altinn.apps.fisher.db.FishCategoryDBHelper.java com.altinn.apps.fisher.db.FormDBHelper.java com.altinn.apps.fisher.db.IDBHelper.java com.altinn.apps.fisher.db.RegsDBHelper.java com.altinn.apps.fisher.db.VesselDBHelper.java com.altinn.apps.fisher.gps.CLocationProvider.java com.altinn.apps.fisher.gps.ILocationUpdateListner.java com.altinn.apps.fisher.models.CaughtInfoData.java com.altinn.apps.fisher.models.InfoData.java com.altinn.apps.fisher.models.ReportInfoData.java com.altinn.apps.fisher.models.UserProfile.java com.altinn.apps.fisher.net.AbstractWorkerTask.java com.altinn.apps.fisher.net.CookieHelper.java com.altinn.apps.fisher.net.IParser.java com.altinn.apps.fisher.net.JSParser.java com.altinn.apps.fisher.net.ParseManager.java com.altinn.apps.fisher.net.TaskNotifier.java com.altinn.apps.fisher.net.jsobj.AttachmentObj.java com.altinn.apps.fisher.net.jsobj.FormObj.java com.altinn.apps.fisher.net.jsobj.JSConstants.java com.altinn.apps.fisher.net.jsobj.JsonObj.java com.altinn.apps.fisher.net.jsobj.LinkItemObj.java com.altinn.apps.fisher.net.jsobj.LinkObj.java com.altinn.apps.fisher.net.jsobj.MessageObj.java com.altinn.apps.fisher.net.jsobj.MessagesEmbedded.java com.altinn.apps.fisher.net.jsobj.OrganisationObj.java com.altinn.apps.fisher.net.tasks.LoginTask.java com.altinn.apps.fisher.net.tasks.RefreshTokenTask.java com.altinn.apps.fisher.net.tasks.SendReportTask.java com.altinn.apps.fisher.net.tasks.UserProfileTask.java com.altinn.apps.fisher.settings.FactoryDetails.java com.altinn.apps.fisher.settings.FishDetails.java com.altinn.apps.fisher.settings.SettingItem.java com.altinn.apps.fisher.settings.VesselsDetails.java com.altinn.apps.fisher.ui.component.DurationTimePickDialog.java com.altinn.apps.fisher.ui.component.RAutoCompleteTextView.java com.altinn.apps.fisher.ui.component.RButton.java com.altinn.apps.fisher.ui.component.REditText.java com.altinn.apps.fisher.ui.component.RTextView.java com.altinn.apps.fisher.ui.screen.BaseActivity.java com.altinn.apps.fisher.ui.screen.BrowserActivity.java com.altinn.apps.fisher.ui.screen.FactoryDetailsActivity.java com.altinn.apps.fisher.ui.screen.HomeActivity.java com.altinn.apps.fisher.ui.screen.InformationActivity.java com.altinn.apps.fisher.ui.screen.MenuNavigationActivity.java com.altinn.apps.fisher.ui.screen.ReportActivity.java com.altinn.apps.fisher.ui.screen.ReportReceivedFishActivity.java com.altinn.apps.fisher.ui.screen.ReportSendDetailActivity.java com.altinn.apps.fisher.ui.screen.SplashActivity.java com.altinn.apps.fisher.ui.screen.UserProfileActivity.java com.altinn.apps.fisher.utils.PreferenceUtils.java com.altinn.apps.fisher.utils.Utils.java net.simonvt.menudrawer.BuildLayerFrameLayout.java net.simonvt.menudrawer.ColorDrawable.java net.simonvt.menudrawer.DraggableDrawer.java net.simonvt.menudrawer.FloatScroller.java net.simonvt.menudrawer.MenuDrawer.java net.simonvt.menudrawer.NoClickThroughFrameLayout.java net.simonvt.menudrawer.OverlayDrawer.java net.simonvt.menudrawer.PeekInterpolator.java net.simonvt.menudrawer.Position.java net.simonvt.menudrawer.Scroller.java net.simonvt.menudrawer.SinusoidalInterpolator.java net.simonvt.menudrawer.SlideDrawable.java net.simonvt.menudrawer.SlidingDrawer.java net.simonvt.menudrawer.SmoothInterpolator.java net.simonvt.menudrawer.StaticDrawer.java net.simonvt.menudrawer.ViewHelper.java net.simonvt.menudrawer.compat.ActionBarHelperCompat.java net.simonvt.menudrawer.compat.ActionBarHelperNative.java net.simonvt.menudrawer.compat.ActionBarHelper.java