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


Java GradientDrawable.Orientation方法代码示例

本文整理汇总了Java中android.graphics.drawable.GradientDrawable.Orientation方法的典型用法代码示例。如果您正苦于以下问题:Java GradientDrawable.Orientation方法的具体用法?Java GradientDrawable.Orientation怎么用?Java GradientDrawable.Orientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.drawable.GradientDrawable的用法示例。


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

示例1: getDropShadowOrientation

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
@Override
protected GradientDrawable.Orientation getDropShadowOrientation() {
    switch (getPosition()) {
        case TOP:
            return GradientDrawable.Orientation.TOP_BOTTOM;

        case RIGHT:
            return GradientDrawable.Orientation.RIGHT_LEFT;

        case BOTTOM:
            return GradientDrawable.Orientation.BOTTOM_TOP;

        default:
            return GradientDrawable.Orientation.LEFT_RIGHT;
    }
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:17,代码来源:OverlayDrawer.java

示例2: getDropShadowOrientation

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
protected GradientDrawable.Orientation getDropShadowOrientation() {
    // Gets the orientation for the static and sliding drawer. The overlay drawer provides its own implementation.
    switch (getPosition()) {
        case TOP:
            return GradientDrawable.Orientation.BOTTOM_TOP;

        case RIGHT:
            return GradientDrawable.Orientation.LEFT_RIGHT;

        case BOTTOM:
            return GradientDrawable.Orientation.TOP_BOTTOM;

        default:
            return GradientDrawable.Orientation.RIGHT_LEFT;
    }
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:17,代码来源:MenuDrawer.java

示例3: getOrientation

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private GradientDrawable.Orientation getOrientation() {
    GradientDrawable.Orientation orientation;
    switch (bgGradientOrientation) {
        case ORIENTATION_BOTTOM_TOP:
            orientation = GradientDrawable.Orientation.BOTTOM_TOP;
            break;
        case ORIENTATION_RIGHT_LEFT:
            orientation = GradientDrawable.Orientation.RIGHT_LEFT;
            break;
        case ORIENTATION_LEFT_RIGHT:
            orientation = GradientDrawable.Orientation.LEFT_RIGHT;
            break;
        case ORIENTATION_BL_TR:
            orientation = GradientDrawable.Orientation.BL_TR;
            break;
        case ORIENTATION_TR_BL:
            orientation = GradientDrawable.Orientation.TR_BL;
            break;
        case ORIENTATION_BR_TL:
            orientation = GradientDrawable.Orientation.BR_TL;
            break;
        case ORIENTATION_TL_BR:
            orientation = GradientDrawable.Orientation.TL_BR;
            break;
        default:
            orientation = GradientDrawable.Orientation.TOP_BOTTOM;
            break;
    }

    return orientation;
}
 
开发者ID:appwise-labs,项目名称:NoInternetDialog,代码行数:32,代码来源:NoInternetDialog.java

示例4: setDropShadowColor

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
/**
 * Sets the color of the drop shadow.
 *
 * @param color The color of the drop shadow.
 */
public void setDropShadowColor(int color) {
    GradientDrawable.Orientation orientation = getDropShadowOrientation();

    final int endColor = color & 0x00FFFFFF;
    mDropShadowDrawable = new GradientDrawable(orientation,
            new int[] {
                    color,
                    endColor,
            });
    invalidate();
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:17,代码来源:MenuDrawer.java

示例5: updateListBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateListBG(){
    if(getDrawerLayout() != null) {
        SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
        int mainColor = themePrefs.getInt("drawerListColor", 0xffffffff);
        int value = themePrefs.getInt("drawerRowGradient", 0);
        boolean b = true;//themePrefs.getBoolean("drawerRowGradientListCheck", false);
        if (value > 0 && b) {
            GradientDrawable.Orientation go;
            switch (value) {
                case 2:
                    go = GradientDrawable.Orientation.LEFT_RIGHT;
                    break;
                case 3:
                    go = GradientDrawable.Orientation.TL_BR;
                    break;
                case 4:
                    go = GradientDrawable.Orientation.BL_TR;
                    break;
                default:
                    go = GradientDrawable.Orientation.TOP_BOTTOM;
            }

            int gradColor = themePrefs.getInt("drawerRowGradientColor", 0xffffffff);
            int[] colors = new int[]{mainColor, gradColor};
            GradientDrawable gd = new GradientDrawable(go, colors);
            getDrawerLayout().setBackgroundDrawable(gd);
        } else {
            getDrawerLayout().setBackgroundColor(mainColor);
        }
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:32,代码来源:DrawerLayoutContainer.java

示例6: updateListBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateListBG(){
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("profileRowColor", 0xffffffff);
    int value = themePrefs.getInt("profileRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("profileRowGradientListCheck", false);
    if(value > 0  && b) {
        GradientDrawable.Orientation go;
        switch(value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("profileRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        listView.setBackgroundDrawable(gd);
    }else{
        listView.setBackgroundColor(mainColor);
    }
    //listView.setGlowColor(mainColor);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:31,代码来源:ProfileActivity.java

示例7: updateActionBarBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateActionBarBG(){
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
    int hColor = themePrefs.getInt("profileHeaderColor", def);
    actionBar.setBackgroundColor(hColor);
    listView.setGlowColor(hColor);
    topViewColor = hColor;
    int val = themePrefs.getInt("profileHeaderGradient", 0);
    if (val > 0) {
        topViewColor = 0x00000000;
        int gradColor = themePrefs.getInt("profileHeaderGradientColor", def);
        GradientDrawable.Orientation go;
        switch (val) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
                topViewColor = gradColor;
        }
        int[] colors = new int[]{hColor, gradColor};
        GradientDrawable actionBarGradient = new GradientDrawable(go, colors);
        actionBar.setBackgroundDrawable(actionBarGradient);
    }
    topView.setBackgroundColor(topViewColor);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:33,代码来源:ProfileActivity.java

示例8: updateTheme

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateTheme() {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);

    int hColor = themePrefs.getInt("contactsHeaderColor", def);
    actionBar.setBackgroundColor(hColor);
    int val = themePrefs.getInt("contactsHeaderGradient", 0);
    if (val > 0) {
        GradientDrawable.Orientation go;
        switch (val) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }
        int gradColor = themePrefs.getInt("contactsHeaderGradientColor", def);
        int[] colors = new int[]{hColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        actionBar.setBackgroundDrawable(gd);
    }

    actionBar.setTitleColor(themePrefs.getInt("contactsHeaderTitleColor", 0xffffffff));

    Drawable search = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_search);
    search.setColorFilter(themePrefs.getInt("contactsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY);

    //Drawable clear = getParentActivity().getResources().getDrawable(R.drawable.ic_close_white);
    //clear.setColorFilter(AndroidUtilities.getIntDef("contactsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY);
    //Drawable lock = getParentActivity().getResources().getDrawable(R.drawable.lock_close);
    //lock.setColorFilter(themePrefs.getInt("contactsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY);
    //lock = getParentActivity().getResources().getDrawable(R.drawable.lock_open);
    //lock.setColorFilter(themePrefs.getInt("contactsHeaderIconsColor", 0xffffffff), PorterDuff.Mode.MULTIPLY);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:41,代码来源:ContactsActivity.java

示例9: updateViewColor

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateViewColor(View v) {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("drawerListColor", 0xffffffff);
    int value = themePrefs.getInt("drawerRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("drawerRowGradientListCheck", false);
    if (value > 0 && !b) {
        GradientDrawable.Orientation go;
        switch (value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("drawerRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        v.setBackgroundDrawable(gd);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:28,代码来源:DrawerLayoutAdapter.java

示例10: updateListBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateListBG(ViewGroup vg){
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
    int value = themePrefs.getInt("contactsRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
    if(value > 0 && b) {
        GradientDrawable.Orientation go;
        switch(value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        vg.setBackgroundDrawable(gd);
    }else{
        vg.setBackgroundColor(mainColor);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:30,代码来源:OnlineContactsAdapter.java

示例11: updateViewColor

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateViewColor(View v){
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
    int value = themePrefs.getInt("contactsRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
    if(value > 0 && !b) {
        GradientDrawable.Orientation go;
        switch(value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        v.setBackgroundDrawable(gd);
    } else if(b){
        v.setBackgroundColor(0x00000000);
    }
    if(value > 0)v.setTag("Contacts00");
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:31,代码来源:OnlineContactsAdapter.java

示例12: updateListBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateListBG(ViewGroup vg) {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
    int value = themePrefs.getInt("contactsRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
    if (value > 0 && b) {
        GradientDrawable.Orientation go;
        switch (value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        vg.setBackgroundDrawable(gd);
    } else {
        vg.setBackgroundColor(mainColor);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:30,代码来源:ContactsAdapter.java

示例13: updateViewColor

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateViewColor(View v) {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int mainColor = themePrefs.getInt("contactsRowColor", 0xffffffff);
    int value = themePrefs.getInt("contactsRowGradient", 0);
    boolean b = true;//themePrefs.getBoolean("contactsRowGradientListCheck", false);
    if (value > 0 && !b) {
        GradientDrawable.Orientation go;
        switch (value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }

        int gradColor = themePrefs.getInt("contactsRowGradientColor", 0xffffffff);
        int[] colors = new int[]{mainColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        v.setBackgroundDrawable(gd);
    } else if (b) {
        v.setBackgroundColor(0x00000000);
    }
    if (value > 0) v.setTag("Contacts00");
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:31,代码来源:ContactsAdapter.java

示例14: updateListBG

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
private void updateListBG() {


        SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
        int mainColor = themePrefs.getInt("chatsRowColor", 0xffffffff);
        int value = themePrefs.getInt("chatsRowGradient", 0);
        boolean b = true;//themePrefs.getBoolean("chatsRowGradientListCheck", false);
        if (value > 0 && b) {
            GradientDrawable.Orientation go;
            switch (value) {
                case 2:
                    go = GradientDrawable.Orientation.LEFT_RIGHT;
                    break;
                case 3:
                    go = GradientDrawable.Orientation.TL_BR;
                    break;
                case 4:
                    go = GradientDrawable.Orientation.BL_TR;
                    break;
                default:
                    go = GradientDrawable.Orientation.TOP_BOTTOM;
            }

            int gradColor = themePrefs.getInt("chatsRowGradientColor", 0xffffffff);
            int[] colors = new int[]{mainColor, gradColor};
            GradientDrawable gd = new GradientDrawable(go, colors);
            listView.setBackgroundDrawable(gd);
        } else {
            listView.setBackgroundColor(mainColor);
        }
    }
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:32,代码来源:DialogsActivity.java

示例15: onBindViewHolder

import android.graphics.drawable.GradientDrawable; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int i) {
    if (viewHolder.getItemViewType() == 0) {
        CustomDialogCell cell = (CustomDialogCell) viewHolder.itemView;
        cell.useSeparator = (i != getItemCount() - 1);
        TLRPC.TL_dialog dialog = getItem(i);
        if (dialogsType == 0) {
            if (AndroidUtilities.isTablet()) {
                cell.setDialogSelected(dialog.id == openedDialogId);
            }
        }
        //Telegram
        SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
        int mainColor = themePrefs.getInt("chatsRowColor", 0xffffffff);
        //cell.setBackgroundColor(mainColor);
        int value = themePrefs.getInt("chatsRowGradient", 0);
        boolean b = true;//themePrefs.getBoolean("chatsRowGradientListCheck", false);
        if(value > 0 && !b) {
            GradientDrawable.Orientation go;
            switch(value) {
                case 2:
                    go = GradientDrawable.Orientation.LEFT_RIGHT;
                    break;
                case 3:
                    go = GradientDrawable.Orientation.TL_BR;
                    break;
                case 4:
                    go = GradientDrawable.Orientation.BL_TR;
                    break;
                default:
                    go = GradientDrawable.Orientation.TOP_BOTTOM;
            }

            int gradColor = themePrefs.getInt("chatsRowGradientColor", 0xffffffff);
            int[] colors = new int[]{mainColor, gradColor};
            GradientDrawable gd = new GradientDrawable(go, colors);
            cell.setBackgroundDrawable(gd);
        }
        //


        cell.setDialog(dialog, i, dialogsType);

    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:46,代码来源:CustomDialogAdapter.java


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