Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SettingsSubActivity.java « hexeditorwatchface « clusterrr « com « java « main « src « app - github.com/ClusterM/wear-os-hex-editor-watchface.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 791dd34204b073c697f22b4b3739867284c9df0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.clusterrr.hexeditorwatchface;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.wear.widget.WearableLinearLayoutManager;
import androidx.wear.widget.WearableRecyclerView;

public class SettingsSubActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        int setting = intent.getIntExtra("setting", 0);
        String[] values = intent.getStringArrayExtra("values");
        int selected = intent.getIntExtra("selected", 0);
        setContentView(R.layout.settings_activity);
        WearableRecyclerView recyclerView = findViewById(R.id.settings_menu_view);
        if (getResources().getBoolean(R.bool.is_round)) {
            recyclerView.setEdgeItemsCenteringEnabled(true);
            CustomScrollingLayoutCallback customScrollingLayoutCallback =
                    new CustomScrollingLayoutCallback();
            recyclerView.setLayoutManager(
                    new WearableLinearLayoutManager(this, customScrollingLayoutCallback));
        } else {
            recyclerView.setLayoutManager(
                    new WearableLinearLayoutManager(this));
        }
        recyclerView.setAdapter(new SettingsSubMenuAdapter(this, setting, values, selected));
    }
}