类android.support.annotation.Keep源码实例Demo

下面列出了怎么用android.support.annotation.Keep的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: TelePlus-Android   文件: DrawerLayoutContainer.java
@Keep
public void setDrawerPosition(float value)
{
    drawerPosition = value;
    if (drawerPosition > drawerLayout.getMeasuredWidth())
    {
        drawerPosition = drawerLayout.getMeasuredWidth();
    }
    else if (drawerPosition < 0)
    {
        drawerPosition = 0;
    }
    drawerLayout.setTranslationX(drawerPosition);

    final int newVisibility = drawerPosition > 0 ? VISIBLE : GONE;
    if (drawerLayout.getVisibility() != newVisibility)
    {
        drawerLayout.setVisibility(newVisibility);
    }
    setScrimOpacity(drawerPosition / (float) drawerLayout.getMeasuredWidth());
}
 
源代码2 项目: TelePlus-Android   文件: FragmentContextView.java
@Keep
public void setTopPadding(float value)
{
    topPadding = value;
    if (fragment != null)
    {
        View view = fragment.getFragmentView();
        int additionalPadding = 0;
        if (additionalContextView != null && additionalContextView.getVisibility() == VISIBLE)
        {
            additionalPadding = AndroidUtilities.dp(36);
        }
        if (view != null)
        {
            view.setPadding(0, (int) topPadding + additionalPadding, 0, 0);
        }
        if (isLocation && additionalContextView != null)
        {
            ((LayoutParams) additionalContextView.getLayoutParams()).topMargin = -AndroidUtilities.dp(36) - (int) topPadding;
        }
    }
}
 
源代码3 项目: TelePlus-Android   文件: AudioPlayerAlert.java
@Keep
public void setFullAnimationProgress(float value) {
    fullAnimationProgress = value;
    placeholderImageView.setRoundRadius(AndroidUtilities.dp(20 * (1.0f - fullAnimationProgress)));
    float scale = 1.0f + thumbMaxScale * fullAnimationProgress;
    placeholderImageView.setScaleX(scale);
    placeholderImageView.setScaleY(scale);
    float translationY = placeholderImageView.getTranslationY();
    placeholderImageView.setTranslationX(thumbMaxX * fullAnimationProgress);
    placeholderImageView.setTranslationY(startTranslation + (endTranslation - startTranslation) * fullAnimationProgress);
    playerLayout.setTranslationY(panelStartTranslation + (panelEndTranslation - panelStartTranslation) * fullAnimationProgress);
    shadow2.setTranslationY(panelStartTranslation + (panelEndTranslation - panelStartTranslation) * fullAnimationProgress + playerLayout.getMeasuredHeight());
    menuItem.setAlpha(fullAnimationProgress);
    searchItem.setAlpha(1.0f - fullAnimationProgress);
    avatarContainer.setAlpha(1.0f - fullAnimationProgress);
    actionBar.getTitleTextView().setAlpha(fullAnimationProgress);
    actionBar.getSubtitleTextView().setAlpha(fullAnimationProgress);
}
 
源代码4 项目: TelePlus-Android   文件: ChatAttachAlert.java
@Keep
@SuppressLint("NewApi")
protected void setRevealRadius(float radius) {
    revealRadius = radius;
    if (Build.VERSION.SDK_INT <= 19) {
        listView.invalidate();
    }
    if (!isDismissed()) {
        for (int a = 0; a < innerAnimators.size(); a++) {
            InnerAnimator innerAnimator = innerAnimators.get(a);
            if (innerAnimator.startRadius > radius) {
                continue;
            }
            innerAnimator.animatorSet.start();
            innerAnimators.remove(a);
            a--;
        }
    }
}
 
源代码5 项目: TelePlus-Android   文件: FragmentContextView.java
@Keep
public void setTopPadding(float value)
{
    topPadding = value;
    if (fragment != null)
    {
        View view = fragment.getFragmentView();
        int additionalPadding = 0;
        if (additionalContextView != null && additionalContextView.getVisibility() == VISIBLE)
        {
            additionalPadding = AndroidUtilities.dp(36);
        }
        if (view != null)
        {
            view.setPadding(0, (int) topPadding + additionalPadding, 0, 0);
        }
        if (isLocation && additionalContextView != null)
        {
            ((LayoutParams) additionalContextView.getLayoutParams()).topMargin = -AndroidUtilities.dp(36) - (int) topPadding;
        }
    }
}
 
源代码6 项目: AutoTrackAppClick6   文件: SensorsDataAPI.java
/**
 * Track 事件
 *
 * @param eventName  String 事件名称
 * @param properties JSONObject 事件属性
 */
@Keep
public void track(@NonNull final String eventName, @Nullable JSONObject properties) {
    try {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("event", eventName);
        jsonObject.put("device_id", mDeviceId);

        JSONObject sendProperties = new JSONObject(mDeviceInfo);

        if (properties != null) {
            SensorsDataPrivate.mergeJSONObject(properties, sendProperties);
        }

        jsonObject.put("properties", sendProperties);
        jsonObject.put("time", System.currentTimeMillis());

        Log.i(TAG, SensorsDataPrivate.formatJson(jsonObject.toString()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
/**
 * View 被点击,自动埋点
 *
 * @param view View
 */
@Keep
public static void trackViewOnClick(View view) {
    try {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("$element_type", SensorsDataPrivate.getElementType(view));
        jsonObject.put("$element_id", SensorsDataPrivate.getViewId(view));
        jsonObject.put("$element_content", SensorsDataPrivate.getElementContent(view));

        Activity activity = SensorsDataPrivate.getActivityFromView(view);
        if (activity != null) {
            jsonObject.put("$activity", activity.getClass().getCanonicalName());
        }

        SensorsDataAPI.getInstance().track("$AppClick", jsonObject);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
/**
 * Track 页面浏览事件
 *
 * @param activity Activity
 */
@Keep
private static void trackAppViewScreen(Activity activity) {
    try {
        if (activity == null) {
            return;
        }
        if (mIgnoredActivities.contains(activity.getClass().getCanonicalName())) {
            return;
        }
        JSONObject properties = new JSONObject();
        properties.put("$activity", activity.getClass().getCanonicalName());
        properties.put("$title", getActivityTitle(activity));
        SensorsDataAPI.getInstance().track("$AppViewScreen", properties);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码9 项目: Phantom   文件: ActivityHostProxy.java
/**
 * 插件中有时可能希望得到宿主的占位Activity,传递给其他组件使用,而其他组件希望使用这个Activity实例来访问宿主的资源。
 * 例如:在插件中弹出通知,通知的图标希望使用宿主的图标,这时就需要访问宿主资源。
 *
 * @return 占位Activity实例
 */
@Keep
public Activity getShadow() {
    try {
        ActivityHostProxy shadow = (ActivityHostProxy) this.clone();
        shadow.useHostTheme();
        return shadow;
    } catch (CloneNotSupportedException e) {
        VLog.w(e, "clone ActivityHostProxy exception");

        String msg = String.format("proxy %s for plugin activity %s cannot clone",
                this.getClass().getSimpleName(), mPluginComponentName);
        HashMap<String, Object> params = new HashMap<>(1);
        params.put(LogReporter.Key.MESSAGE, msg);
        LogReporter.reportState(LogReporter.EventId.PROXY_ACTIVITY_CANNOT_CLONE, false, params);
    }

    return null;
}
 
源代码10 项目: TelePlus-Android   文件: DrawerLayoutContainer.java
@Keep
public void setDrawerPosition(float value)
{
    drawerPosition = value;
    if (drawerPosition > drawerLayout.getMeasuredWidth())
    {
        drawerPosition = drawerLayout.getMeasuredWidth();
    }
    else if (drawerPosition < 0)
    {
        drawerPosition = 0;
    }
    drawerLayout.setTranslationX(drawerPosition);

    final int newVisibility = drawerPosition > 0 ? VISIBLE : GONE;
    if (drawerLayout.getVisibility() != newVisibility)
    {
        drawerLayout.setVisibility(newVisibility);
    }
    setScrimOpacity(drawerPosition / (float) drawerLayout.getMeasuredWidth());
}
 
源代码11 项目: TelePlus-Android   文件: GroupCreateActivity.java
@Keep
public void setContainerHeight(int value) {
    containerHeight = value;
    if (spansContainer != null) {
        spansContainer.requestLayout();
    }
}
 
源代码12 项目: TelePlus-Android   文件: InstantCameraView.java
@Keep
@Override
public void setAlpha(float alpha) {
    ColorDrawable colorDrawable = (ColorDrawable) getBackground();
    colorDrawable.setAlpha((int) (0xc0 * alpha));
    invalidate();
}
 
源代码13 项目: TelePlus-Android   文件: SecretMediaViewer.java
@Keep
@Override
public void setAlpha(int alpha) {
    if (parentActivity instanceof LaunchActivity) {
        ((LaunchActivity) parentActivity).drawerLayoutContainer.setAllowDrawContent(!isPhotoVisible || alpha != 255);
    }
    super.setAlpha(alpha);
}
 
@Keep
public void setAnimationIdicatorProgress(float value) {
    animationIdicatorProgress = value;

    TextView newTab = (TextView) tabsContainer.getChildAt(currentPosition);
    TextView prevTab = (TextView) tabsContainer.getChildAt(previousPosition);
    setAnimationProgressInernal(newTab, prevTab, value);

    if (delegate != null) {
        delegate.onPageScrolled(value);
    }
}
 
源代码15 项目: TelePlus-Android   文件: InviteContactsActivity.java
@Keep
public void setContainerHeight(int value) {
    containerHeight = value;
    if (spansContainer != null) {
        spansContainer.requestLayout();
    }
}
 
源代码16 项目: TelePlus-Android   文件: PipRoundVideoView.java
@Keep
public void setY(int value) {
    windowLayoutParams.y = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
源代码17 项目: DanDanPlayForAndroid   文件: CircleProgressView.java
@Keep
public void updateProgress(int progress) {
    if (progress > 100)
        progress = 100;
    this.progress = progress;
    invalidate();
}
 
源代码18 项目: TelePlus-Android   文件: Switch2.java
@Keep
public void setProgress(float value)
{
    if (progress == value)
    {
        return;
    }
    progress = value;
    invalidate();
}
 
源代码19 项目: TelePlus-Android   文件: CheckBoxSquare.java
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
源代码20 项目: TelePlus-Android   文件: InstantCameraView.java
@Keep
@Override
public void setAlpha(float alpha) {
    ColorDrawable colorDrawable = (ColorDrawable) getBackground();
    colorDrawable.setAlpha((int) (0xc0 * alpha));
    invalidate();
}
 
@Keep
public void setAnimationIdicatorProgress(float value) {
    animationIdicatorProgress = value;

    TextView newTab = (TextView) tabsContainer.getChildAt(currentPosition);
    TextView prevTab = (TextView) tabsContainer.getChildAt(previousPosition);
    setAnimationProgressInernal(newTab, prevTab, value);

    if (delegate != null) {
        delegate.onPageScrolled(value);
    }
}
 
源代码22 项目: TelePlus-Android   文件: CheckBox.java
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
源代码23 项目: TelePlus-Android   文件: AnimatedArrowDrawable.java
@Keep
public void setAnimationProgress(float progress) {
    animProgress = progress;
    animateToProgress = progress;
    updatePath();
    invalidateSelf();
}
 
源代码24 项目: TelePlus-Android   文件: PipRoundVideoView.java
@Keep
public void setX(int value) {
    windowLayoutParams.x = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
源代码25 项目: TelePlus-Android   文件: PipRoundVideoView.java
@Keep
public void setY(int value) {
    windowLayoutParams.y = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
源代码26 项目: TelePlus-Android   文件: PipRoundVideoView.java
@Keep
public void setX(int value) {
    windowLayoutParams.x = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
源代码27 项目: AutoTrackAppClick6   文件: SensorsDataAPI.java
@Keep
@SuppressWarnings("UnusedReturnValue")
public static SensorsDataAPI init(Application application) {
    synchronized (mLock) {
        if (null == INSTANCE) {
            INSTANCE = new SensorsDataAPI(application);
        }
        return INSTANCE;
    }
}
 
@Keep
public static void trackTabHost(String tabName) {
    try {
        JSONObject properties = new JSONObject();

        properties.put("$element_type", "TabHost");
        properties.put("$element_content", tabName);
        SensorsDataAPI.getInstance().track("$AppClick", properties);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码29 项目: TelePlus-Android   文件: ActionBarLayout.java
@Keep
public void setThemeAnimationValue(float value)
{
    themeAnimationValue = value;
    for (int j = 0; j < 2; j++)
    {
        if (themeAnimatorDescriptions[j] != null)
        {
            int rE, gE, bE, aE, rS, gS, bS, aS, a, r, g, b;
            for (int i = 0; i < themeAnimatorDescriptions[j].length; i++)
            {
                rE = Color.red(animateEndColors[j][i]);
                gE = Color.green(animateEndColors[j][i]);
                bE = Color.blue(animateEndColors[j][i]);
                aE = Color.alpha(animateEndColors[j][i]);

                rS = Color.red(animateStartColors[j][i]);
                gS = Color.green(animateStartColors[j][i]);
                bS = Color.blue(animateStartColors[j][i]);
                aS = Color.alpha(animateStartColors[j][i]);

                a = Math.min(255, (int) (aS + (aE - aS) * value));
                r = Math.min(255, (int) (rS + (rE - rS) * value));
                g = Math.min(255, (int) (gS + (gE - gS) * value));
                b = Math.min(255, (int) (bS + (bE - bS) * value));
                themeAnimatorDescriptions[j][i].setColor(Color.argb(a, r, g, b), false, false);
            }
            if (themeAnimatorDelegate[j] != null)
            {
                themeAnimatorDelegate[j].didSetColor();
            }
        }
    }
}
 
源代码30 项目: XposedHider   文件: XposedHook.java
@Keep
public void handleLoadPackage(Context context, XC_LoadPackage.LoadPackageParam lpparam) {
    mSdcard = Environment.getExternalStorageDirectory().getPath();
    if (!isXposedModule(context, lpparam.appInfo)) {
        next(lpparam);
    }
}
 
 类方法
 同包方法