use of android.support.v7.widget.helper.ItemTouchHelper.START in project Gladys-Android-App by LeptitGeek.
the class AlarmFragment method clickRecurring.
public void clickRecurring() {
MaterialDialog dialog = new MaterialDialog.Builder(getActivity()).title(R.string.recurring).customView(R.layout.dialog_recurring_alarm, false).positiveText(R.string.positve_button).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
getConnection();
if (connection) {
if (rec_alarm_name.getText().toString().isEmpty() | rec_alarm_time.getText().toString().isEmpty()) {
if (getActivity() != null) {
SnackbarUtils.simpleSnackBar(getContext(), getView(), getContext().getString(R.string.all_fields));
}
} else {
id_of_day = DateTimeUtils.getIdDay(day_of_week);
createAlarmRec();
}
}
}
}).negativeText(R.string.negative_button).show();
rec_alarm_name = dialog.getCustomView().findViewById(R.id.recurring_alarm_name);
rec_alarm_name.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
rec_name = rec_alarm_name.getText().toString();
}
@Override
public void afterTextChanged(Editable s) {
}
});
rec_alarm_time = (EditText) dialog.findViewById(R.id.recurring_alarm_time);
rec_alarm_time.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePicker("rec");
}
});
Spinner alarm_rec_day = dialog.getCustomView().findViewById(R.id.recurring_alarm_day);
alarm_rec_day.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
day_of_week = parent.getItemAtPosition(position).toString();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
use of android.support.v7.widget.helper.ItemTouchHelper.START in project Gladys-Android-App by LeptitGeek.
the class AlarmFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
FloatingActionButton fab = getActivity().findViewById(R.id.fab);
fab.setVisibility(View.VISIBLE);
fab.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getConnection();
if (connection) {
getAllAlarms();
}
}
});
}
use of android.support.v7.widget.helper.ItemTouchHelper.START in project Gladys-Android-App by LeptitGeek.
the class RejectedSentencesFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_rejected_sentences, container, false);
recycler_view = view.findViewById(R.id.rv_fragment_rejected_sentences);
recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
recycler_view.setLayoutManager(layoutManager);
no_data_rejected = view.findViewById(R.id.no_data_rejected);
no_data_rejected_ic = view.findViewById(R.id.no_data_rejected_ic);
final FloatingActionButton fab_scroll_up_rejected = view.findViewById(R.id.fab_scroll_up_rejected);
fab_scroll_up_rejected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
recycler_view.smoothScrollToPosition(0);
fab_scroll_up_rejected.animate().translationY(fab_scroll_up_rejected.getHeight() + 400).setInterpolator(new LinearInterpolator()).start();
}
});
onCreateAdapterView();
return view;
}
use of android.support.v7.widget.helper.ItemTouchHelper.START in project Gladys-Android-App by LeptitGeek.
the class DashboardFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
SugarContext.init(getContext());
FloatingActionButton fab = getActivity().findViewById(R.id.fab);
fab.setVisibility(View.VISIBLE);
fab.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getConnection();
if (connection) {
getAllDevicetypeByRoom();
}
}
});
}
use of android.support.v7.widget.helper.ItemTouchHelper.START in project Gladys-Android-App by LeptitGeek.
the class DeviceActivity method initialdeclarations.
public void initialdeclarations() {
Toolbar toolbar = findViewById(R.id.toolbar_device);
setSupportActionBar(toolbar);
recycler_view = findViewById(R.id.device_rv);
recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recycler_view.setLayoutManager(layoutManager);
final FloatingActionButton fab_scroll_up = findViewById(R.id.fab_scroll_up);
fab_scroll_up.setVisibility(View.VISIBLE);
fab_scroll_up.animate().translationY(fab_scroll_up.getHeight() + 400).setInterpolator(new LinearInterpolator()).start();
fab_scroll_up.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
recycler_view.smoothScrollToPosition(0);
fab_scroll_up.animate().translationY(fab_scroll_up.getHeight() + 400).setInterpolator(new LinearInterpolator()).start();
}
});
}
Aggregations