added link to bot in tg stickers info
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
import android.widget.EditText;
|
||||
@@ -82,30 +83,30 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
|
||||
private void openMenu(String toast) {
|
||||
if (toast != null) {
|
||||
Toast.makeText(getContext(), toast, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(requireContext(), toast, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
var intent = new Navigator(StickersPreferencesFragment.class, new Bundle()).b(getContext());
|
||||
var intent = new Navigator(StickersPreferencesFragment.class, new Bundle()).b(requireContext());
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
super.getContext().startActivity(intent);
|
||||
super.requireContext().startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getContext().registerReceiver(mReceiver, new IntentFilter(ACTION_RELOAD));
|
||||
requireContext().registerReceiver(mReceiver, new IntentFilter(ACTION_RELOAD));
|
||||
|
||||
mGrabber = new TelegramStickersGrabber(TGPref.getTGBotKey());
|
||||
mService = TelegramStickersService.getInstance(getContext());
|
||||
mService = TelegramStickersService.getInstance(requireContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateContent(@NonNull LayoutInflater inflater, @Nullable Bundle bundle) {
|
||||
setTitle(R.string.vtltgs);
|
||||
|
||||
FrameLayout layout = new FrameLayout(getContext());
|
||||
FrameLayout layout = new FrameLayout(requireContext());
|
||||
|
||||
mAdapter = new StickerPackAdapter();
|
||||
RecyclerView mRecycler = new RecyclerView(getContext());
|
||||
RecyclerView mRecycler = new RecyclerView(requireContext());
|
||||
|
||||
var callback = new StickerTouchHelperCallback(mAdapter);
|
||||
var touchHelper = new ItemTouchHelper(callback);
|
||||
@@ -115,7 +116,7 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
mRecycler.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
|
||||
layout.addView(mRecycler, new ViewGroup.LayoutParams(-1, -1));
|
||||
|
||||
FloatingActionButton mAddStickerPack = new FloatingActionButton(getContext());
|
||||
FloatingActionButton mAddStickerPack = new FloatingActionButton(requireContext());
|
||||
mAddStickerPack.setImageResource(R.drawable.ic_add_24);
|
||||
mAddStickerPack.setBackgroundTintList(ThemesUtils.getAccenedColorStateList());
|
||||
mAddStickerPack.setOnClickListener(v2 -> fabClick());
|
||||
@@ -154,9 +155,9 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
}
|
||||
} else if (method == TYPE_DIRECT) {
|
||||
final Runnable callback = () -> {
|
||||
LinearLayout linearLayout = new LinearLayout(getContext());
|
||||
LinearLayout linearLayout = new LinearLayout(requireContext());
|
||||
|
||||
final EditText editText = new EditText(getContext());
|
||||
final EditText editText = new EditText(requireContext());
|
||||
editText.setHintTextColor(ThemesUtils.getSTextAttr());
|
||||
editText.setBackgroundTintList(ThemesUtils.getAccenedColorStateList());
|
||||
|
||||
@@ -166,7 +167,7 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
margin.setMargins(AndroidUtils.dp2px(24f), 0, AndroidUtils.dp2px(24f), 0);
|
||||
editText.setLayoutParams(margin);
|
||||
|
||||
new VkAlertDialog.Builder(getContext())
|
||||
new VkAlertDialog.Builder(requireContext())
|
||||
.setTitle(requireContext().getString(R.string.stickershelp1))
|
||||
.setMessage(requireContext().getString(R.string.stickershelp2))
|
||||
.setView(linearLayout)
|
||||
@@ -178,7 +179,7 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
AndroidUtils.sendToast(AndroidUtils.getString("invalid_pack_link"));
|
||||
}
|
||||
pack = parsePack(pack);
|
||||
mService.requestPackDownload(pack, new File(getContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
|
||||
mService.requestPackDownload(pack, new File(requireContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
|
||||
})
|
||||
.setNeutralButton(android.R.string.cancel,
|
||||
(dialog, which) -> dialog.dismiss()
|
||||
@@ -212,9 +213,9 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
}
|
||||
|
||||
private void enterBotKey(Runnable r) {
|
||||
LinearLayout linearLayout = new LinearLayout(getContext());
|
||||
LinearLayout linearLayout = new LinearLayout(requireContext());
|
||||
|
||||
final EditText editText = new EditText(getContext());
|
||||
final EditText editText = new EditText(requireContext());
|
||||
editText.setHintTextColor(ThemesUtils.getSTextAttr());
|
||||
editText.setBackgroundTintList(ThemesUtils.getAccenedColorStateList());
|
||||
|
||||
@@ -224,7 +225,7 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
margin.setMargins(AndroidUtils.dp2px(24f), 0, AndroidUtils.dp2px(24f), 0);
|
||||
editText.setLayoutParams(margin);
|
||||
|
||||
new VkAlertDialog.Builder(getContext())
|
||||
new VkAlertDialog.Builder(requireContext())
|
||||
.setTitle(requireContext().getString(R.string.stickersapi5))
|
||||
.setMessage(requireContext().getString(R.string.stickersapi6))
|
||||
.setView(linearLayout)
|
||||
@@ -236,10 +237,15 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
(dialog, which) -> dialog.dismiss()
|
||||
)
|
||||
.setNeutralButton(requireContext().getString(R.string.stickersapi7),
|
||||
(dialog, which) -> new VkAlertDialog.Builder(getContext())
|
||||
(dialog, which) -> new VkAlertDialog.Builder(requireContext())
|
||||
.setTitle(requireContext().getString(R.string.stickersapi8))
|
||||
.setMessage(requireContext().getString(R.string.stickersapi9) +
|
||||
requireContext().getString(R.string.stickersapi10))
|
||||
.setNeutralButton("Открыть бота", (dl, i) -> {
|
||||
var intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/botfather"));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
requireActivity().startActivity(intent);
|
||||
})
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
)
|
||||
@@ -249,7 +255,7 @@ public class StickersFragment extends BaseToolbarFragment {
|
||||
private void checkApiKey(Runnable callback) {
|
||||
mGrabber.setBotApiKey(TGPref.getTGBotKey());
|
||||
|
||||
var context = getContext();
|
||||
var context = requireContext();
|
||||
|
||||
final ProgressDialog progressDialog = new ProgressDialog(context);
|
||||
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
|
||||
Reference in New Issue
Block a user