android.support.annotation.Keep Java Examples

The following examples show how to use android.support.annotation.Keep. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SensorsDataPrivate.java    From AutoTrackAppViewScreen with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #2
Source File: SensorsDataAutoTrackHelper.java    From AutoTrackAppClick6 with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #3
Source File: ActivityHostProxy.java    From Phantom with Apache License 2.0 6 votes vote down vote up
/**
 * 插件中有时可能希望得到宿主的占位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;
}
 
Example #4
Source File: SensorsDataAPI.java    From AutoTrackAppClick6 with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #5
Source File: DrawerLayoutContainer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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());
}
 
Example #6
Source File: FragmentContextView.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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;
        }
    }
}
 
Example #7
Source File: DrawerLayoutContainer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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());
}
 
Example #8
Source File: ChatAttachAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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--;
        }
    }
}
 
Example #9
Source File: FragmentContextView.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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;
        }
    }
}
 
Example #10
Source File: AudioPlayerAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #11
Source File: InstantCameraView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
@Override
public void setAlpha(float alpha) {
    ColorDrawable colorDrawable = (ColorDrawable) getBackground();
    colorDrawable.setAlpha((int) (0xc0 * alpha));
    invalidate();
}
 
Example #12
Source File: Switch2.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setProgress(float value)
{
    if (progress == value)
    {
        return;
    }
    progress = value;
    invalidate();
}
 
Example #13
Source File: CircleProgressView.java    From DanDanPlayForAndroid with MIT License 5 votes vote down vote up
@Keep
public void updateProgress(int progress) {
    if (progress > 100)
        progress = 100;
    this.progress = progress;
    invalidate();
}
 
Example #14
Source File: XposedHook.java    From XposedHider with GNU General Public License v3.0 5 votes vote down vote up
@Keep
public void handleLoadPackage(Context context, XC_LoadPackage.LoadPackageParam lpparam) {
    mSdcard = Environment.getExternalStorageDirectory().getPath();
    if (!isXposedModule(context, lpparam.appInfo)) {
        next(lpparam);
    }
}
 
Example #15
Source File: GroupCreateCheckBox.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
Example #16
Source File: SecretMediaViewer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
@Override
public void setAlpha(int alpha) {
    if (parentActivity instanceof LaunchActivity) {
        ((LaunchActivity) parentActivity).drawerLayoutContainer.setAllowDrawContent(!isPhotoVisible || alpha != 255);
    }
    super.setAlpha(alpha);
}
 
Example #17
Source File: GroupCreateActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setContainerHeight(int value) {
    containerHeight = value;
    if (spansContainer != null) {
        spansContainer.requestLayout();
    }
}
 
Example #18
Source File: RadioButton.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
Example #19
Source File: PipRoundVideoView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setY(int value) {
    windowLayoutParams.y = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
Example #20
Source File: CheckBoxSquare.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
Example #21
Source File: ActionBarLayout.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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();
            }
        }
    }
}
 
Example #22
Source File: SensorsDataAutoTrackHelper.java    From AutoTrackAppClick6 with Apache License 2.0 5 votes vote down vote up
@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();
    }
}
 
Example #23
Source File: InstantCameraView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
@Override
public void setAlpha(float alpha) {
    ColorDrawable colorDrawable = (ColorDrawable) getBackground();
    colorDrawable.setAlpha((int) (0xc0 * alpha));
    invalidate();
}
 
Example #24
Source File: SensorsDataAPI.java    From AutoTrackAppClick6 with Apache License 2.0 5 votes vote down vote up
@Keep
@SuppressWarnings("UnusedReturnValue")
public static SensorsDataAPI init(Application application) {
    synchronized (mLock) {
        if (null == INSTANCE) {
            INSTANCE = new SensorsDataAPI(application);
        }
        return INSTANCE;
    }
}
 
Example #25
Source File: PipRoundVideoView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setX(int value) {
    windowLayoutParams.x = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
Example #26
Source File: PipRoundVideoView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setY(int value) {
    windowLayoutParams.y = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}
 
Example #27
Source File: ScrollSlidingTextTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #28
Source File: CheckBox.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setProgress(float value) {
    if (progress == value) {
        return;
    }
    progress = value;
    invalidate();
}
 
Example #29
Source File: AnimatedArrowDrawable.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setAnimationProgress(float progress) {
    animProgress = progress;
    animateToProgress = progress;
    updatePath();
    invalidateSelf();
}
 
Example #30
Source File: PipRoundVideoView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Keep
public void setX(int value) {
    windowLayoutParams.x = value;
    try {
        windowManager.updateViewLayout(windowView, windowLayoutParams);
    } catch (Exception ignore) {

    }
}