use of net.iGap.libs.rippleeffect.RippleView in project iGap-Android by KianIranian-STDG.
the class ShowMediaListener method initComponent.
private void initComponent(View view, List<RealmRoomMessage> roomMessages) {
RippleView rippleBackBtn = view.findViewById(R.id.asi_ripple_back);
rippleBackBtn.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
@Override
public void onComplete(RippleView rippleView) {
G.fragmentActivity.getSupportFragmentManager().popBackStackImmediate();
}
});
RippleView rippleMenu = view.findViewById(R.id.asi_ripple_menu);
rippleMenu.setOnRippleCompleteListener(rippleView -> popUpMenuTopSheet(roomMessages.get(selectedFile)));
imgPlay = view.findViewById(R.id.imgPlay);
viewPager = view.findViewById(R.id.asi_view_pager);
contentNumberTv = view.findViewById(R.id.asi_txt_image_number);
toolbarLl = view.findViewById(R.id.toolbarShowContent);
room = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmRoom.class).equalTo("id", roomMessages.get(selectedFile).roomId).findFirst();
});
imgPlay.setOnClickListener(v -> {
if (exoPlayer.isPlaying()) {
exoPlayer.pause();
} else {
exoPlayer.setPlayWhenReady(true);
}
});
initViewPager(roomMessages);
}
use of net.iGap.libs.rippleeffect.RippleView in project iGap-Android by KianIranian-STDG.
the class FragmentIgapSearch method initComponent.
private void initComponent(View view) {
// view.findViewById(R.id.sfl_ll_toolbar).setBackgroundColor(Color.parseColor(G.appBarColor));
imvNothingFound = view.findViewById(R.id.sfl_imv_nothing_found);
imvNothingFound.setImageResource(R.drawable.find1);
txtEmptyListComment = view.findViewById(R.id.sfl_txt_empty_list_comment);
// txtNothing = (TextView) view.findViewById(R.id.sfl_txt_empty_nothing);
// txtNothing.setVisibility(View.VISIBLE);
G.handler.postDelayed(new Runnable() {
@Override
public void run() {
imvNothingFound.setVisibility(View.VISIBLE);
txtEmptyListComment.setVisibility(View.VISIBLE);
}
}, 150);
loadingProgressBar = view.findViewById(R.id.sfl_progress_loading);
loadingProgressBar.getIndeterminateDrawable().setColorFilter(new Theme().getAccentColor(getContext()), PorterDuff.Mode.SRC_IN);
// edtSearch = view.findViewById(R.id.sfl_edt_search);
edtSearch.setInputType(InputType.TYPE_CLASS_TEXT);
// edtSearch.setFilters(new InputFilter[] {
// new InputFilter() {
// public CharSequence filter(CharSequence src, int start, int end, Spanned dst, int dstart, int dend) {
//
// Log.e("qqqqqq", src + " " + start + " " + end + " " + dst + " " + dstart + " " + dend);
//
// if (src.equals("") || (dst.length() == 0 && src.equals("@"))) {
// return src;
// }
// if (src.toString().matches("\\w")) {
// return src;
// }
// return "";
// }
// }
// });
edtSearch.setText("@");
edtSearch.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
int strSize = edtSearch.getText().toString().length();
// filter some character
if (strSize > 1) {
String _str = edtSearch.getText().toString().substring(strSize - 1);
if (!_str.matches("\\w")) {
edtSearch.setText(edtSearch.getText().subSequence(0, strSize - 1));
edtSearch.setSelection(edtSearch.getText().length());
}
}
if (strSize > 5) {
if (getRequestManager().isUserLogin()) {
if ((!edtSearch.getText().toString().equals(preventRepeatSearch))) {
itemAdapter.clear();
new RequestClientSearchUsername().clientSearchUsername(edtSearch.getText().toString().substring(1));
loadingProgressBar.setVisibility(View.VISIBLE);
preventRepeatSearch = edtSearch.getText().toString();
}
} else {
HelperError.showSnackMessage(G.context.getString(R.string.there_is_no_connection_to_server), false);
}
}
}
@Override
public void afterTextChanged(Editable editable) {
if (edtSearch.getText().length() == 0 || !edtSearch.getText().toString().substring(0, 1).equals("@")) {
edtSearch.setText("@");
edtSearch.setSelection(1);
}
}
});
edtSearch.requestFocus();
InputMethodManager imm = (InputMethodManager) G.context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(edtSearch, InputMethodManager.SHOW_IMPLICIT);
/*
MaterialDesignTextView btnBack = (MaterialDesignTextView) view.findViewById(R.id.sfl_btn_back);
final RippleView rippleBack = (RippleView) view.findViewById(R.id.sfl_ripple_back);
rippleBack.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
@Override
public void onComplete(RippleView rippleView) {
InputMethodManager imm = (InputMethodManager) G.fragmentActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(rippleBack.getWindowToken(), 0);
//G.fragmentActivity.getSupportFragmentManager().beginTransaction().remove(FragmentIgapSearch.this).commit();
G.fragmentActivity.onBackPressed();
}
});
*/
// btnClose = (MaterialDesignTextView) view.findViewById(R.id.sfl_btn_close);
btnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edtSearch.setText("@");
edtSearch.setSelection(1);
}
});
// rippleDown = view.findViewById(R.id.sfl_ripple_done);
rippleDown.setEnabled(false);
rippleDown.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
@Override
public void onComplete(RippleView rippleView) {
}
});
recyclerView = view.findViewById(R.id.sfl_recycleview);
}
Aggregations