正在查看: Delta Chat v1.58.3 应用的 StickerSelectActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Delta Chat v1.58.3 应用的 StickerSelectActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package org.thoughtcrime.securesms.scribbles;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.scribbles.StickerSelectFragment;
public class StickerSelectActivity extends FragmentActivity implements StickerSelectFragment.StickerSelectionListener {
public static final String EXTRA_STICKER_FILE = "extra_sticker_file";
private static final int[] TAB_TITLES = {R.drawable.ic_tag_faces_white_24dp, R.drawable.ic_work_white_24dp, R.drawable.ic_pets_white_24dp, R.drawable.ic_local_dining_white_24dp, R.drawable.ic_wb_sunny_white_24dp};
private static final String TAG = "StickerSelectActivity";
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.scribble_select_sticker_activity);
ViewPager findViewById = findViewById(R.id.camera_sticker_pager);
findViewById.setAdapter(new StickerPagerAdapter(getSupportFragmentManager(), this));
TabLayout findViewById2 = findViewById(R.id.camera_sticker_tabs);
findViewById2.setupWithViewPager(findViewById);
for (int i = 0; i < findViewById2.getTabCount(); i++) {
findViewById2.getTabAt(i).setIcon(TAB_TITLES[i]);
}
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == 16908332) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onStickerSelected(String str) {
Intent intent = new Intent();
intent.putExtra(EXTRA_STICKER_FILE, str);
setResult(-1, intent);
finish();
}
static class StickerPagerAdapter extends FragmentStatePagerAdapter {
private final Fragment[] fragments;
StickerPagerAdapter(FragmentManager fragmentManager, StickerSelectFragment.StickerSelectionListener stickerSelectionListener) {
super(fragmentManager);
Fragment[] fragmentArr = {StickerSelectFragment.newInstance("stickers/emoticons"), StickerSelectFragment.newInstance("stickers/clothes"), StickerSelectFragment.newInstance("stickers/animals"), StickerSelectFragment.newInstance("stickers/food"), StickerSelectFragment.newInstance("stickers/weather")};
this.fragments = fragmentArr;
for (Fragment fragment : fragmentArr) {
((StickerSelectFragment) fragment).setListener(stickerSelectionListener);
}
}
public Fragment getItem(int i) {
return this.fragments[i];
}
public int getCount() {
return this.fragments.length;
}
}
}