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


Java SwipeMenuListView.setOpenInterpolator方法代码示例

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


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

示例1: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Quiz");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Android Quiz", "IT Quiz", "Tech Debate"};

    images = new int[] {R.drawable.android,R.drawable.itquiz,R.drawable.techdebate};

    timing = new String[] {"1:00 PM - 6:00 PM, CC3","2:00 PM - 8:00 PM, CC3","9:00 AM - 6:00 PM, CC3"};

    intents = new String[]{"AND", "ITQ", "TECDE"};

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Cat_quiz.java

示例2: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.d("hello","maa chuda android studio");
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Coding");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Alkhwarizm", "Blind War", "C Fresh", "C Hunt", "C Master", "Ex-Machina", "Humble Fool Cup", "Infinitum", "Three Muskeeters"};

    images = new int[] {R.drawable.alkhwarizm, R.drawable.blindwar,R.drawable.cfresh,R.drawable.chunt,R.drawable.cmaster,R.drawable.exmachina,R.drawable.humblefool,R.drawable.infinitum, R.drawable.threemuski};

    timing = new String[] {"6:00 PM, CC3", "6:00 PM, CC3","2:00 PM - 6:00 PM, CC3","6:00 PM, CC3","6:00 PM, CC3","6:00 PM, CC3","6:00 PM, CC3", "6:00 PM, CC3", "6:00 PM, CC3"};

    intents = new String[]{"ALK", "BLI", "CFR", "CHU", "CMA", "EXM", "HUM", "INF", "THR"};

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:79,代码来源:Cat_coding.java

示例3: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Day 1");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0x52, 0xb3,
                    0xd9)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xff,
                    0x00, 0x00)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Aparoksha Inauguration Ceremony", "Hack In The North Opening Ceremony", "Treasure Hunt", "Movie - Steve Jobs (2015)", "Hack In the North", "Blind Wars",  "Movie - The Martian (2015)"};

    images = new int[] {R.drawable.aparoksha_logo,R.drawable.hackinthenorth,R.drawable.treasurehunt,R.mipmap.ic_launcher,R.drawable.hackinthenorth,R.drawable.blindwar,R.mipmap.ic_launcher };

    timing = new String[] {"6.30 PM, Main Audi","9.30 PM, Main Audi","10 PM, CC3","11 PM, Main Audi/LT","12 AM, CC3 3rd Floor","12 AM, CC3 1st Floor","1 AM, Main Audi/LT"};

    intents = new String[]{"MAIN1", "HAC", "TRE", "MAIN1", "HAC", "BLI","MAIN1", };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Day0.java

示例4: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Day 4");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0x52, 0xb3,
                    0xd9)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xff,
                    0x00, 0x00)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Pool Master","Flappy Bird","Novita","Three Musketeers","Riddilonics Final Round","C Fresh Finals",
            "Android Quiz","Backbone"};

    images = new int[] {R.drawable.pool,R.drawable.flappy,R.mipmap.ic_launcher,R.drawable.threemuski,R.drawable.riddlonics,
    R.drawable.cfresh,R.drawable.android,R.drawable.backbone};

    timing = new String[] {"11 AM - 1 PM, Swimming Pool","12 AM - 1 PM, Tennis Court","1.30 PM - 4.30 PM, Admin Audi",
            "1.30 PM - 3.30 PM, CC3","1.30 PM - 3.30 PM, Lab 2311","3.30 PM - 4.30 PM, CC3","3.30 PM - 4.30 PM, CC3 5006","4.30 PM - 6.30 PM"
    ,"CC3 First Floor Labs"};

    intents = new String[]{"POO", "FLA", "MAIN1", "THR", "RID","CFR","AND","BAC" };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:81,代码来源:Day3.java

示例5: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Development");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Backbone", "Coldfire", "Eureka", "GIT Hero", "Tri Hacker Cup", "Webkriti"};

    images = new int[] {R.drawable.backbone,R.drawable.first,R.drawable.eureka,R.drawable.githero,R.drawable.trihacker,R.drawable.webkrit,R.mipmap.ic_launcher, };

    timing = new String[] {"All day","2:00 PM, CC3","4:00 PM, CC3","3:00 PM - 5:00 PM, CC3","6:00 PM, CC3","2:30 PM, CC3"};

    intents = new String[]{"BAC", "COL", "EUR", "GIT", "TRI", "WEB" };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Cat_development.java

示例6: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Games");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Age of Empires III", "Clash of Clans", "Counter Strike", "FIFA", "Flappy Bird", "Split Second", "Tekken 6"};

    images = new int[] {R.drawable.ageofempire,R.drawable.clash,R.drawable.counter,R.drawable.fifa,R.drawable.flappy,R.drawable.splitsecond,R.drawable.tekken6};

    timing = new String[] {"1:00 PM, CC3","10:00 AM, CC3","3:00 PM, CC3", "4:00 PM, CC3","All Day", "4:00 PM - 8 PM, CC3", "8:00 PM, CC3"};

    intents = new String[]{"AGE", "CLA", "COU", "FIF", "FLA", "SPL", "TEK"};

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Cat_games.java

示例7: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Misc");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"FB Sharing Contest", "Mr. Googler", "Pencil Sketching", "Tinder Time", "Treasure Hunt", "V Flare", "Qwerty Wars"};

    images = new int[] {R.drawable.fbshare,R.drawable.mrgoogler,R.drawable.pencilsketck,R.drawable.tindertime,R.drawable.treasurehunt,R.drawable.vflare, R.drawable.qwertywars};

    timing = new String[] {"3:00 PM - 5:00 PM, CC3","1:00 PM - 4:00 PM, CC3","5:00 PM - 8:00 PM, CC3","All Day","3:00 PM - 9:00 PM, CC3", "2:00 PM - 5:00 PM, CC3", "3:00 PM - 7:00 PM, CC3"};

    intents = new String[]{"FBS", "MRG", "PEN", "TIN", "TRE", "VFL", "QWE", };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Cat_misc.java

示例8: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/JosefinSans-Regular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()
    );
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    act_name = (TextView)findViewById(R.id.activity_name);
    Typeface tf1 = Typeface.createFromAsset(getAssets(),
            "JosefinSans-Regular.ttf");

    act_name.setTypeface(tf1);
    act_name.setText("Electronics");

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xf4, 0x43,
                    0x36)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0x28,
                    0x28, 0x28)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Black Box", "Bolt", "Pool Runner", "Riddilonics", "Technofault", "Techno Booz", "Wolf of 2311"};

    images = new int[] {R.drawable.blackbox,R.drawable.bolt,R.drawable.pool,R.drawable.riddlonics,R.drawable.technofault,R.drawable.technobooz, R.drawable.wolfof};

    timing = new String[] {"2:00 PM, CC3","All Day","4:00 PM, CC3","4:45 PM, CC3","6:00 PM, CC3", "6:30 PM, CC3", "All Day"};

    intents = new String[]{"BLA", "BOL", "POO", "RID", "TECFA", "TECBO", "WOL" };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:77,代码来源:Cat_electronics.java

示例9: onCreate

import com.baoyz.swipemenulistview.SwipeMenuListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.eventsnow);

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mList = (SwipeMenuListView) findViewById(R.id.listView);
    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0x38, 0x8e,
                    0x3c)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xff,
                    0x00, 0x00)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_settings);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mList.setMenuCreator(creator);
    mList.setOpenInterpolator(new BounceInterpolator());
    mList.setCloseInterpolator(new BounceInterpolator());



    //Add events in this array
    events_1 = new String[] {"Director's Cut", "Double Trouble", "Innovation", "Bindaas Bol", "Tongues on fire","Kahaani"};

    images = new int[] {R.mipmap.ic_launcher,R.mipmap.ic_launcher,R.mipmap.ic_launcher,R.mipmap.ic_launcher,R.mipmap.ic_launcher,R.mipmap.ic_launcher,R.mipmap.ic_launcher, };

    timing = new String[] {"All day","Sat, 15:00","Fri, 22:00","Fri, 13:00","Sat, 15:00","All day"};

    intents = new String[]{"DES", "DES", "DES", "DES", "DES", "DES", "DES", "DES", "DES", "DES", "DES", };

    initList(events_1, images, timing, intents);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:66,代码来源:EventNow.java


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