use of me.ccrama.redditslide.Adapters.SubChooseAdapter in project Slide by ccrama.
the class SetupWidget method doShortcut.
public void doShortcut() {
setContentView(R.layout.activity_setup_widget);
setupAppBar(R.id.toolbar, R.string.widget_creation_title, true, true);
header = getLayoutInflater().inflate(R.layout.widget_header, null);
ListView list = (ListView) findViewById(R.id.subs);
final ArrayList<String> sorted = UserSubscriptions.getSubscriptionsForShortcut(SetupWidget.this);
final SubChooseAdapter adapter = new SubChooseAdapter(this, sorted, UserSubscriptions.getAllSubreddits(this));
list.addHeaderView(header);
list.setAdapter(adapter);
(header.findViewById(R.id.sort)).clearFocus();
((EditText) header.findViewById(R.id.sort)).addTextChangedListener(new SimpleTextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
final String result = editable.toString();
adapter.getFilter().filter(result);
}
});
}
use of me.ccrama.redditslide.Adapters.SubChooseAdapter in project Slide by ccrama.
the class Shortcut method doShortcut.
public void doShortcut() {
setContentView(R.layout.activity_setup_widget);
setupAppBar(R.id.toolbar, R.string.shortcut_creation_title, true, true);
header = getLayoutInflater().inflate(R.layout.shortcut_header, null);
ListView list = (ListView) findViewById(R.id.subs);
list.addHeaderView(header);
final ArrayList<String> sorted = UserSubscriptions.getSubscriptionsForShortcut(Shortcut.this);
final SubChooseAdapter adapter = new SubChooseAdapter(this, sorted, UserSubscriptions.getAllSubreddits(this));
list.setAdapter(adapter);
(header.findViewById(R.id.sort)).clearFocus();
((EditText) header.findViewById(R.id.sort)).addTextChangedListener(new SimpleTextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
final String result = editable.toString();
adapter.getFilter().filter(result);
}
});
}
Aggregations