Search in sources :

Example 81 with START

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) {
        }
    });
}
Also used : MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Spinner(android.widget.Spinner) SelfSigningClientBuilder(com.gladysinc.gladys.Utils.SelfSigningClientBuilder) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) DialogAction(com.afollestad.materialdialogs.DialogAction) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) AdapterView(android.widget.AdapterView)

Example 82 with START

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();
            }
        }
    });
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FloatingActionButton(android.support.design.widget.FloatingActionButton) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView)

Example 83 with START

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;
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FloatingActionButton(android.support.design.widget.FloatingActionButton) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Example 84 with START

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();
            }
        }
    });
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FloatingActionButton(android.support.design.widget.FloatingActionButton) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Example 85 with START

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();
        }
    });
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FloatingActionButton(android.support.design.widget.FloatingActionButton) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

View (android.view.View)367 RecyclerView (android.support.v7.widget.RecyclerView)271 TextView (android.widget.TextView)175 Intent (android.content.Intent)109 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)84 Toolbar (android.support.v7.widget.Toolbar)77 TextWatcher (android.text.TextWatcher)77 Editable (android.text.Editable)76 ImageView (android.widget.ImageView)76 ArrayList (java.util.ArrayList)68 Bundle (android.os.Bundle)48 DialogInterface (android.content.DialogInterface)47 AlertDialog (android.support.v7.app.AlertDialog)47 AdapterView (android.widget.AdapterView)46 EditText (android.widget.EditText)42 SuppressLint (android.annotation.SuppressLint)39 Button (android.widget.Button)39 ActionBar (android.support.v7.app.ActionBar)34 List (java.util.List)34 ViewPropertyAnimatorCompat (android.support.v4.view.ViewPropertyAnimatorCompat)33