本文整理汇总了Java中android.support.v7.graphics.drawable.DrawerArrowDrawable.setProgress方法的典型用法代码示例。如果您正苦于以下问题:Java DrawerArrowDrawable.setProgress方法的具体用法?Java DrawerArrowDrawable.setProgress怎么用?Java DrawerArrowDrawable.setProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.graphics.drawable.DrawerArrowDrawable
的用法示例。
在下文中一共展示了DrawerArrowDrawable.setProgress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openMenuDrawable
import android.support.v7.graphics.drawable.DrawerArrowDrawable; //导入方法依赖的package包/类
private void openMenuDrawable(final DrawerArrowDrawable drawerArrowDrawable, boolean withAnim) {
if (withAnim) {
ValueAnimator anim = ValueAnimator.ofFloat(0.0f, 1.0f);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
drawerArrowDrawable.setProgress(value);
}
});
anim.setDuration(MENU_ICON_ANIM_DURATION);
anim.start();
} else {
drawerArrowDrawable.setProgress(1.0f);
}
}
示例2: closeMenuDrawable
import android.support.v7.graphics.drawable.DrawerArrowDrawable; //导入方法依赖的package包/类
private void closeMenuDrawable(final DrawerArrowDrawable drawerArrowDrawable, boolean withAnim) {
if (withAnim) {
ValueAnimator anim = ValueAnimator.ofFloat(1.0f, 0.0f);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
drawerArrowDrawable.setProgress(value);
}
});
anim.setDuration(MENU_ICON_ANIM_DURATION);
anim.start();
} else {
drawerArrowDrawable.setProgress(0.0f);
}
}
示例3: onCreate
import android.support.v7.graphics.drawable.DrawerArrowDrawable; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gimbal = new Gimbal(this);
gimbal.lock();
setContentView(R.layout.activity_about);
ButterKnife.bind(this);
toolbar.setTitle(R.string.app_name);
DrawerArrowDrawable drawerArrowDrawable = new DrawerArrowDrawable(this);
drawerArrowDrawable.setProgress(1.0f);
toolbar.setNavigationIcon(drawerArrowDrawable);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);
GithubClient.instance().contributors(REPO_USER, REPO_NAME, contributorResponseCallback);
}
示例4: onCreate
import android.support.v7.graphics.drawable.DrawerArrowDrawable; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String name = getIntent().getStringExtra(EXTRA_FILE_NAME);
mPath = getIntent().getStringExtra(EXTRA_FILE_PATH);
setContentView(R.layout.activity_view_text_file);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
DrawerArrowDrawable drawerDrawable = new DrawerArrowDrawable(this);
drawerDrawable.setColor(getResources().getColor(android.R.color.white));
drawerDrawable.setProgress(1f);
toolbar.setNavigationIcon(drawerDrawable);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(name);
getSupportActionBar().setHomeButtonEnabled(true);
mContentView = (TextView) findViewById(R.id.content);
mStorage = new Storage(this);
byte[] bytes = mStorage.readFile(mPath);
mContentView.setText(new String(bytes));
}
示例5: onCreate
import android.support.v7.graphics.drawable.DrawerArrowDrawable; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* 返回按钮图标 */
btnReturnIcon = new DrawerArrowDrawable(this);
btnReturnIcon.setColor(getResources().getColor(R.color.white));
btnReturnIcon.setProgress(1f);
receiver = new DownloadReceiver();
}