fixed toolbar visibility
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.dockbar;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
|
||||
import android.os.Bundle;
|
||||
@@ -19,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
|
||||
public class DockBarEditorFragment extends MaterialPreferenceToolbarFragment{
|
||||
@@ -28,13 +30,20 @@ public class DockBarEditorFragment extends MaterialPreferenceToolbarFragment{
|
||||
private ItemTouchHelperCallback mCallback;
|
||||
private ItemTouchHelper mItemTouchHelper;
|
||||
|
||||
@Override
|
||||
public int T4(){
|
||||
return getIdentifier("vtltgs", "string");
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle){
|
||||
super.onCreateView(layoutInflater, viewGroup, bundle);
|
||||
View root = super.onCreateView(layoutInflater, viewGroup, bundle);
|
||||
|
||||
FrameLayout content = root.findViewById(R.id.appkit_content);
|
||||
|
||||
LinearLayout container = new LinearLayout(getContext());
|
||||
container.setOrientation(LinearLayout.VERTICAL);
|
||||
container.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
|
||||
content.addView(container, new FrameLayout.LayoutParams(-1, -1));
|
||||
|
||||
LinearLayout buttonsContainer = new LinearLayout(getContext());
|
||||
buttonsContainer.setPadding(
|
||||
@@ -83,6 +92,6 @@ public class DockBarEditorFragment extends MaterialPreferenceToolbarFragment{
|
||||
mItemTouchHelper = new ItemTouchHelper(mCallback);
|
||||
mItemTouchHelper.attachToRecyclerView(mRecycler);
|
||||
|
||||
return container;
|
||||
return root;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Themes.getAccentColor;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -17,8 +18,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -28,6 +27,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
@@ -36,6 +36,7 @@ import com.aefyr.tsg.g2.TelegramStickersService;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.vk.navigation.Navigator;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
import java.io.File;
|
||||
@@ -79,14 +80,6 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment{
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater){
|
||||
super.onCreateOptionsMenu(menu, menuInflater);
|
||||
MenuItem add = menu.add(0, 0, 0, "");
|
||||
add.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||
add.setIcon(getResources().getDrawable(getIdentifier("ic_settings_24", "drawable")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem arg0){
|
||||
openMenu(null);
|
||||
@@ -107,37 +100,35 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment{
|
||||
public void onCreate(@Nullable Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
getContext().registerReceiver(mReceiver, new IntentFilter(ACTION_RELOAD));
|
||||
|
||||
mGrabber = new TelegramStickersGrabber(TGPref.getTGBotKey());
|
||||
mService = TelegramStickersService.getInstance(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View arg0, Bundle arg1){
|
||||
setMenuVisibility(true);
|
||||
super.onViewCreated(arg0, arg1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView(){
|
||||
super.onDestroyView();
|
||||
getContext().unregisterReceiver(mReceiver);
|
||||
public int T4(){
|
||||
return getIdentifier("vtltgs", "string");
|
||||
}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
@SuppressWarnings("rawtypes")
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState){
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View root = super.onCreateView(inflater, container, savedInstanceState);
|
||||
|
||||
mGrabber = new TelegramStickersGrabber(TGPref.getTGBotKey());
|
||||
mService = TelegramStickersService.getInstance(getContext());
|
||||
FrameLayout layout = root.findViewById(R.id.appkit_content);
|
||||
|
||||
FrameLayout layout = new FrameLayout(getContext());
|
||||
layout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
|
||||
Toolbar toolbar = root.findViewById(R.id.toolbar);
|
||||
var item = toolbar.getMenu().add(0, 0, 0, "");
|
||||
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||
item.setIcon(getResources().getDrawable(getIdentifier("ic_settings_24", "drawable")));
|
||||
|
||||
mAdapter = new StickerPackAdapter();
|
||||
mRecycler = new RecyclerView(getContext());
|
||||
mRecycler.setAdapter(mAdapter);
|
||||
mRecycler.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
|
||||
layout.addView(mRecycler, new FrameLayout.LayoutParams(-1, -1));
|
||||
layout.addView(mRecycler, new ViewGroup.LayoutParams(-1, -1));
|
||||
|
||||
mAddStickerPack = new FloatingActionButton(getContext());
|
||||
mAddStickerPack.setImageResource(getIdentifier("ic_add_24", "drawable"));
|
||||
@@ -149,7 +140,19 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment{
|
||||
params.setMargins(0, 0, 0, convertDpToPixel(12f));
|
||||
layout.addView(mAddStickerPack, params);
|
||||
|
||||
return layout;
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View arg0, Bundle arg1){
|
||||
setHasOptionsMenu(true);
|
||||
super.onViewCreated(arg0, arg1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView(){
|
||||
super.onDestroyView();
|
||||
getContext().unregisterReceiver(mReceiver);
|
||||
}
|
||||
|
||||
private void fabClick(){
|
||||
|
||||
Reference in New Issue
Block a user