當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。