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