当前位置: 首页>>代码示例>>Java>>正文


Java Keep类代码示例

本文整理汇总了Java中android.support.annotation.Keep的典型用法代码示例。如果您正苦于以下问题:Java Keep类的具体用法?Java Keep怎么用?Java Keep使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Keep类属于android.support.annotation包,在下文中一共展示了Keep类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDiscreteTransformation

import android.support.annotation.Keep; //导入依赖的package包/类
/**
 * Specifies a transformation for the discrete components. Depends on the implementation,
 * this can change alpha value of some discrete components or theirs current scale for example.
 * <p>
 * This method can be used to animate revealing/concealing of the discrete components or theirs
 * immediate hiding/showing.
 *
 * @param transformation The desired transformation from the range {@code [0.0, 1.0]}.
 *                       Transformation {@code 0.0} means that discrete components will be
 *                       hided, {@code 1.0} means that they will be visible.
 */
@Keep
void setDiscreteTransformation(float transformation) {
	if (this.transformation != transformation) {
		this.transformation = transformation;
		// Scale up/down the discrete indicator and the thumb in a way when one is fully scaled
		// up the other is fully scaled down and reversed.
		setThumbScale(1 - transformation);
		setDiscreteIndicatorScale(transformation);

		// Fade in/out the text of discrete indicator during the indicator is at least 75% transformed/visible.
		if (transformation > 0.75) {
			final int alpha = Math.round((transformation - 0.75f) / 0.25f * 255);
			setDiscreteIndicatorTextAlpha(alpha);
		} else {
			setDiscreteIndicatorTextAlpha(0);
		}

		// Fade in/out discrete interval.
		setDiscreteIntervalAlpha(Math.round(transformation * 255));
		invalidate();
	}
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:34,代码来源:SeekBarWidget.java

示例2: probeDevice

import android.support.annotation.Keep; //导入依赖的package包/类
/**
 * Probes a single device for a compatible driver.
 *
 * @param usbDevice the usb device to probe
 *
 * @return a new {@link UsbSerialDriver} compatible with this device, or
 * {@code null} if none available.
 */
@Keep
public UsbSerialDriver probeDevice(final UsbDevice usbDevice) {
    final int vendorId = usbDevice.getVendorId();
    final int productId = usbDevice.getProductId();
    final Class<? extends UsbSerialDriver> driverClass = mProbeTable.findDriver(vendorId, productId);
    if (driverClass != null) {
        final UsbSerialDriver driver;
        try {
            final Constructor<? extends UsbSerialDriver> constructor = driverClass.getConstructor(UsbDevice.class);
            driver = constructor.newInstance(usbDevice);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return driver;
    }
    return null;
}
 
开发者ID:HelloHuDi,项目名称:usb-with-serial-port,代码行数:26,代码来源:UsbSerialProber.java

示例3: onAppInitializeRequest

import android.support.annotation.Keep; //导入依赖的package包/类
@Subscribe @Keep
public void onAppInitializeRequest(AppInitializeRequestEvent event) {
    // 构造的时候无法执行注入, 推迟到需要的时候再注入
    initialize();

    File dbInCache = new File(cacheDir, "db/store.db");
    if (cacheDir != null && !dbInCache.exists()) {
        appBus.post(new AppInitializeReportEvent("正在缓存数据库"));
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            return;
        }
        if (IoUtils.ensureDirsExist(dbInCache.getParentFile())) {
            IoUtils.copyAssets(AppMain.app().getAssets(), Assets.STORE_DB, dbInCache);
        } else {
            Timber.w("Can't ensure cache dir");
        }
    }
}
 
开发者ID:baoti,项目名称:Pioneer,代码行数:21,代码来源:DataInitializer.java

示例4: valueOfCallbackId

import android.support.annotation.Keep; //导入依赖的package包/类
/**
 * 获取callbackId ,-1为无效值
 * @param callbackIdStr
 * @return 为空或转换失败时返回-1
 */
@Keep
int valueOfCallbackId(String callbackIdStr){
    int callbackId=-1;
    if (TextUtils.isEmpty(callbackIdStr)||callbackIdStr.equals("null")){
        return callbackId;
    }
    try{
        callbackId=Integer.parseInt(callbackIdStr);
    }catch (Exception e){
        if (BDebug.DEBUG){
            e.printStackTrace();
        }
    }
    return callbackId;
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:21,代码来源:EUExBase.java

示例5: verifyValue

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void verifyValue(int value) {
    if (test1 != value) {
        throw new IllegalStateException();
    }
    if (getTest2() != value) {
        throw new IllegalStateException();
    }
    if (test3 != value) {
        throw new IllegalStateException();
    }
}
 
开发者ID:evernote,项目名称:android-state,代码行数:13,代码来源:TestProguard.java

示例6: setValue

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void setValue(int value) {
    mData2.int1 = value;
    mData2.int2 = value;
    mDataReflOtherName.int1 = value;
    mDataReflOtherName.int2 = value;
}
 
开发者ID:evernote,项目名称:android-state,代码行数:8,代码来源:TestProguardBundler.java

示例7: verifyValue

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void verifyValue(int value) {
    if (mData2.int1 != value) {
        throw new IllegalStateException();
    }
    if (mData2.int2 != value) {
        throw new IllegalStateException();
    }
    if (mDataReflOtherName.int1 != value) {
        throw new IllegalStateException();
    }
    if (mDataReflOtherName.int2 != value) {
        throw new IllegalStateException();
    }
}
 
开发者ID:evernote,项目名称:android-state,代码行数:16,代码来源:TestProguardBundler.java

示例8: setAlpha

import android.support.annotation.Keep; //导入依赖的package包/类
@Override
@Keep
public void setAlpha(int alpha) {
    mHand.setAlpha(alpha);
    for (int i = 0; i < mIcons.length; i++) {
        mIcons[i].setAlpha(alpha);
    }
    invalidateSelf();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:10,代码来源:AllAppsBackgroundDrawable.java

示例9: onEvent

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void onEvent(String action) {
    // 垃圾小米 rom 里把 append 方法给删了
    // mTextView.append("接收到消息:" + t + "\n");

    mTextView.setText(null);
    String str = mTextView.getText().toString();
    mTextView.setText(str + "接收到:" + action + "\n");

    Log.d("kymjs", "kymjs=======demo=====" + action);
}
 
开发者ID:kymjs,项目名称:Chidori,代码行数:12,代码来源:MainActivity.java

示例10: onEvent

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void onEvent(String action) {
    // 垃圾小米 rom 里把 append 方法给删了
    // mTextView.append("接收到消息:" + t + "\n");
    String str = mTextView.getText().toString();
    mTextView.setText(str + "接收到:" + action + "\n");
    
    Log.d("kymjs", "kymjs======sample======" + action);
}
 
开发者ID:kymjs,项目名称:Chidori,代码行数:10,代码来源:MainActivity.java

示例11: onLocationChanged

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
@JavascriptInterface
public void onLocationChanged(String xPath) {
    if (xPath == null) {
        return;
    }
    xPathSubject.onNext(xPath);
}
 
开发者ID:smartmobilefactory,项目名称:EpubReaderAndroid,代码行数:9,代码来源:InternalEpubBridge.java

示例12: parseMeta

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep
public void parseMeta(Event event) {
    try {
        if (mTotalPageCount != Integer.MAX_VALUE) {
            storeCache();
        }
        mIndex = Integer.parseInt(event.args.get(KEY_INDEX));
        mTotalPageCount = Integer.parseInt(event.args.get(KEY_PAGE_COUNT));
    } catch (Exception e) {
    }
}
 
开发者ID:alibaba,项目名称:Tangram-Android,代码行数:12,代码来源:SlideCard.java

示例13: LoginViewModel

import android.support.annotation.Keep; //导入依赖的package包/类
/**
 * Creates the view model, with the required application reference.
 */
@Keep
public LoginViewModel(Application application) {
    super(application);
    mApplication = OpenYoloDemoApplication.getInstance(application);
    mUserDataSource = mApplication.getUserRepository();
    mCredentialClient = CredentialClient.getInstance(mApplication);
}
 
开发者ID:openid,项目名称:OpenYOLO-Android,代码行数:11,代码来源:LoginViewModel.java

示例14: SpannedGridLayoutManager

import android.support.annotation.Keep; //导入依赖的package包/类
@Keep /* XML constructor, see RecyclerView#createLayoutManager */
public SpannedGridLayoutManager(
        Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.SpannedGridLayoutManager, defStyleAttr, defStyleRes);
    columns = a.getInt(R.styleable.SpannedGridLayoutManager_spanCount, 1);
    parseAspectRatio(a.getString(R.styleable.SpannedGridLayoutManager_aspectRatio));
    // TODO use this!
    int orientation = a.getInt(
            R.styleable.SpannedGridLayoutManager_android_orientation, RecyclerView.VERTICAL);
    a.recycle();
    setAutoMeasureEnabled(true);
}
 
开发者ID:JaylenHsieh,项目名称:Here,代码行数:14,代码来源:SpannedGridLayoutManager.java

示例15: SQLiteMigrations

import android.support.annotation.Keep; //导入依赖的package包/类
/**
 * New migrations from default assets folder.
 *
 * @param context current application context.
 */
@Keep
public SQLiteMigrations(
    @NonNull final Context context
) {
    this(context, DEFAULT_FOLDER);
}
 
开发者ID:g4s8,项目名称:Android-Migrator,代码行数:12,代码来源:SQLiteMigrations.java


注:本文中的android.support.annotation.Keep类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。