當前位置: 首頁>>代碼示例>>Java>>正文


Java FloatingActionButton.setColorRipple方法代碼示例

本文整理匯總了Java中com.melnykov.fab.FloatingActionButton.setColorRipple方法的典型用法代碼示例。如果您正苦於以下問題:Java FloatingActionButton.setColorRipple方法的具體用法?Java FloatingActionButton.setColorRipple怎麽用?Java FloatingActionButton.setColorRipple使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.melnykov.fab.FloatingActionButton的用法示例。


在下文中一共展示了FloatingActionButton.setColorRipple方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onResume

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
public void onResume() {
    super.onResume();

    listView = (ListView) findViewById(R.id.list_view);
    bartoursAdapter = new BartoursAdapter(
            this,
            bartout.getBartours()
    );
    listView.setAdapter(bartoursAdapter);

    listView.setOnItemClickListener(this);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.newBartourButton);
    fab.attachToListView(listView);

    if(bartout.getActiveBartour() != null) {
        fab.setColorNormal(Color.GRAY);
        fab.setColorPressed(Color.GRAY);
        fab.setColorRipple(Color.GRAY);
    } else {
        fab.setColorNormal(Color.parseColor("#4CAF50"));
        fab.setColorPressed(Color.parseColor("#2E7D32"));
        fab.setColorRipple(Color.parseColor("#43A047"));
    }
}
 
開發者ID:Bartout-Team,項目名稱:Bartout,代碼行數:26,代碼來源:HomeActivity.java

示例2: addHelperFab

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
public void addHelperFab(Context context ,HelperFab.Location location,final HelperFab fab) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
    final FloatingActionButton newFab = (FloatingActionButton)inflater.inflate(R.layout.fab_layout_normal,null);
    newFab.setBackgroundColor(fab.getBackgroundColor());
    newFab.setColorNormal(fab.getBackgroundColor());
    newFab.setColorPressed(fab.getFabSelectedColor());
    newFab.setColorRipple(fab.getFabRippleColor());
    newFab.setImageDrawable(fab.getDrawable());
    newFab.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            fab.onClick();
        }
    });

    if(location == HelperFab.Location.RIGHT) {
        helperFabRight = newFab;
    }
    else if(location == HelperFab.Location.LEFT) {
        helperFabLeft = newFab;
    }
}
 
開發者ID:oznakn,項目名稱:HorizontalFabMenu,代碼行數:24,代碼來源:HorizontalFabMenu.java

示例3: onBindViewHolder

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(ColorPaletteViewHolder holder, final int position) {
    final FloatingActionButton button = holder.getButton();
    button.setColorNormal(mNormalColorList[position]);
    button.setColorPressed(mPressedColorList[position]);
    button.setColorRipple(mRippleColorList[position]);
    setButtonSelectedStatus(button, mSelectedPosition == position);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            setButtonSelectedStatus(button, true);
            updateButtons(position, mSelectedPosition);
            mSelectedPosition = position;
            if (mColorSelectedListener != null) {
                mColorSelectedListener.onColorSelected(position);
            }
        }
    });
}
 
開發者ID:gustavomondron,項目名稱:twik,代碼行數:20,代碼來源:ColorPaletteAdapter.java

示例4: onContentChanged

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
@Override
public void onContentChanged() {
    super.onContentChanged();

    if (!mHasFAB)
        return;

    View view = getWindow().getDecorView().findViewById(android.R.id.content);

    if (view instanceof FrameLayout) {
        FrameLayout base = (FrameLayout) view;

        if (base.findViewById(R.id.fab) == null) {
            FrameLayout layout = (FrameLayout) getLayoutInflater().inflate(R.layout.fab, base);
            mFAB = (FloatingActionButton) layout.findViewById(R.id.fab);
            layout.removeView(mFAB);
            base.addView(mFAB);

            mFAB.setColorRipple(UiUtil.darkerColor(mFAB.getColorNormal(), 0.5f));
            mFAB.setColorPressed(UiUtil.darkerColor(mFAB.getColorNormal(), 0.3f));
            mFAB.setOnClickListener(this);
        }
    }
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:25,代碼來源:ProgressBarActivity.java

示例5: setCheckInButtonColor

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
private void setCheckInButtonColor(View view) {
    FloatingActionButton checkInButton = (FloatingActionButton) view.findViewById(R.id.checkInButton);
    if(bartour == null) {
        checkInButton.setColorNormal(Color.GRAY);
        checkInButton.setColorPressed(Color.GRAY);
        checkInButton.setColorRipple(Color.GRAY);
    } else {
        checkInButton.setColorNormal(Color.parseColor("#4CAF50"));
        checkInButton.setColorPressed(Color.parseColor("#2E7D32"));
        checkInButton.setColorRipple(Color.parseColor("#43A047"));
    }
}
 
開發者ID:Bartout-Team,項目名稱:Bartout,代碼行數:13,代碼來源:BarDetailsFragment.java

示例6: setupMenuItem

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
private static FloatingActionButton setupMenuItem(FloatingActionButton menuBase, int id,
                                                  int drawable,
                                                  int style,
                                                  View.OnClickListener menuItemClickListener) {
    int[] styleValues = new int[]{com.melnykov.fab.R.attr.fab_colorNormal,
                                  com.melnykov.fab.R.attr.fab_colorPressed,
                                  com.melnykov.fab.R.attr.fab_colorRipple,
                                  com.melnykov.fab.R.attr.fab_shadow};
    Context context = menuBase.getContext();
    TypedArray array = context.obtainStyledAttributes(style, styleValues);
    int color;

    FloatingActionButton button = new FloatingActionButton(menuBase.getContext(), null, style);
    button.setId(id);
    button.setType(menuBase.getType());

    if ((color = array.getColor(0, -1)) != -1)
        button.setColorNormal(color);
    if ((color = array.getColor(1, -1)) != -1)
        button.setColorPressed(color);
    if ((color = array.getColor(2, -1)) != -1)
        button.setColorRipple(color);
    if (array.getBoolean(3, false))
        button.setShadow(true);
    else
        button.setShadow(false);
    array.recycle();

    button.setImageResource(drawable);
    button.setLayoutParams(menuBase.getLayoutParams());
    button.setVisibility(View.GONE);
    button.setOnClickListener(menuItemClickListener);
    ((ViewGroup) menuBase.getParent()).addView(button);
    return button;
}
 
開發者ID:rahuliyer95,項目名稱:FABMenu,代碼行數:36,代碼來源:FABMenuUtil.java

示例7: onCreateView

import com.melnykov.fab.FloatingActionButton; //導入方法依賴的package包/類
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //requestPermissions();
        View rootView = inflater.inflate(
                R.layout.fragment_recyclerview, container, false);

        recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
        FastScroller fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
        fastScroller.setRecyclerView(recyclerView);
        audioVisualization = (AudioVisualization) rootView.findViewById(R.id.visualizer_view);
        backdrop = (ImageView) rootView.findViewById(R.id.white_backdrop);

        fab.attachToRecyclerView(recyclerView);
        fab.setColorNormal(getResources().getColor(R.color.colorAccent));
        fab.setColorPressed(getResources().getColor(R.color.widget_pause));
        fab.setColorRipple(getResources().getColor(R.color.window_background));

        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Handler handler = new Handler();
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        MusicPlayer.shuffleAll(getActivity());
                    }
                }, 80);
            }
        });

        new loadSongs().execute("");
        ((BaseActivity) getActivity()).setMusicStateListenerListener(this);

//        if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED
//                && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.MODIFY_AUDIO_SETTINGS) == PackageManager.PERMISSION_GRANTED) {
//
//            requestPermissions();
//
//        }
//
//        requestPermissions();

        SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
        Boolean stateWave = sharedPrefs.getBoolean(getString(R.string.pref_switch_wave_key), true);

        if(stateWave)
            backdrop.setVisibility(View.GONE);
        else
            backdrop.setVisibility(View.VISIBLE);

        return rootView;
    }
 
開發者ID:rohanoid5,項目名稱:Muzesto,代碼行數:55,代碼來源:SongsFragment.java


注:本文中的com.melnykov.fab.FloatingActionButton.setColorRipple方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。