Hi guys I'm having problem with the jfeistein sliding menu. I have correctly imported it but i have only a problem. When I click on the "test" item it opens the related fragment but it doesn't autoclose the menu as it should.
MAINACTIVITY
Code:
public class MainActivity extends Activity {
private SlidingMenu slidingMenu ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
slidingMenu = new SlidingMenu(this);
slidingMenu.setMode(SlidingMenu.LEFT);
slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
slidingMenu.setShadowWidthRes(R.dimen.slidingmenu_shadow_width);
slidingMenu.setShadowDrawable(R.drawable.slidingmenu_shadow);
slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
slidingMenu.setFadeDegree(0.35f);
slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
slidingMenu.setMenu(R.layout.slidingmenu);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public void onBackPressed() {
if ( slidingMenu.isMenuShowing()) {
slidingMenu.toggle();
}
else {
super.onBackPressed();
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ( keyCode == KeyEvent.KEYCODE_MENU ) {
slidingMenu.toggle();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
this.slidingMenu.toggle();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
SLIDING MENU FRAGMENT
Code:
public class SlidingMenuFragment extends Fragment implements ExpandableListView.OnChildClickListener {
private SlidingMenu slidingMenu ;
private ExpandableListView sectionListView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
List<Section> sectionList = createMenu();
View view = inflater.inflate(R.layout.slidingmenu_fragment, container, false);
this.sectionListView = (ExpandableListView) view.findViewById(R.id.slidingmenu_view);
this.sectionListView.setGroupIndicator(null);
SectionListAdapter sectionListAdapter = new SectionListAdapter(this.getActivity(), sectionList);
this.sectionListView.setAdapter(sectionListAdapter);
this.sectionListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
return true;
}
});
this.sectionListView.setOnChildClickListener(this);
int count = sectionListAdapter.getGroupCount();
for (int position = 0; position < count; position++) {
this.sectionListView.expandGroup(position);
}
return view;
}
private List<Section> createMenu() {
List<Section> sectionList = new ArrayList<Section>();
Section oDemoSection = new Section("Demos");
oDemoSection.addSectionItem(101,"Test", "lol");
oDemoSection.addSectionItem(102, "Airport (AsyncTask)", "lol");
Section oGeneralSection = new Section("General");
oGeneralSection.addSectionItem(201, "Settings", "lol");
oGeneralSection.addSectionItem(202, "Rate this app", "lol");
oGeneralSection.addSectionItem(203, "Eula", "lol");
oGeneralSection.addSectionItem(204, "Quit", "lol");
sectionList.add(oDemoSection);
sectionList.add(oGeneralSection);
return sectionList;
}
public void toggle() {
slidingMenu.toggle();
}
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Fragment fragment=null;
switch ((int)id) {
case 101:
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frame_container, new Net()).commit();
break;
case 102:
//TODO
break;
case 201:
//TODO
break;
case 202:
//TODO
break;
case 203:
//TODO
break;
case 204:
//TODO
break;
}
return false;
}}
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Related
Well, here's the idea. Since there are no decent usb headsets that fit the Kaiser (Tilt over here), I'd like to take a stock HTC usb headset, cut the usb portion off, and take my set of Shure headphones and splice them onto the dongle. Problem is tracing the pins from the mini usb to the appropriate wire.
Would like to know if anyone has a pinout of the mini usb port?
Something like:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Data
# A = GND
# B = NC
# C = +DATA
# D = -DATA
# E = +5v
Audio
# 1 = +Mic
# 2 = +Right
# 3 = Switch
# 4 = Gnd
# 5 = Gnd
# 6 = +Left
Wouldn't it be easier to use an adapter?
Lysander said:
Wouldn't it be easier to use an adapter?
Click to expand...
Click to collapse
too ghetto for my taste
This is a rather cool idea - not sure I'd be able to convince myself to start hacking up mu E3C's though!
Good luck.
Ok, the pinout diagram at the top is now verified. I've got everything soldered up and ready, with the exception that I can't decide which ground to use. There are two, and I'm not sure of the implications of using both right and left on one, right on one, left on the other, etc.
Perhaps someone with an adapter can tell me which pin the ground is coming out of on the usb side?
I'm trying to make my own xposed module, which replace some quicksetting icon on my Z1 Compact.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I found this image on SystemUI.apk.
I tried to replace by many ways, but none of them work.
Code:
Log.d("xxx", "yyy"); //try log here, and I saw log on logcat
// try to replace clock icon, it WORKED.
resparam.res.setReplacement("com.android.systemui", "drawable", "stat_sys_alarm", modRes.fwd(R.drawable.stat_sys_alarm));
// try to replace datatraffic icon, it did NOT workd
resparam.res.setReplacement("com.android.systemui", "drawable", "statusbar_datatraffic_off", modRes.fwd(R.drawable.statusbar_datatraffic_off));
resparam.res.setReplacement("com.sonymobile.systemui", "drawable", "statusbar_datatraffic_off", modRes.fwd(R.drawable.statusbar_datatraffic_off));
resparam.res.setReplacement("com.sonymobile.systemui.statusbar.tools", "drawable", "statusbar_datatraffic_off", modRes.fwd(R.drawable.statusbar_datatraffic_off));
//R.drawable.statusbar_datatraffic_off is my own image
Can anyone help me?
Where is that code? handleInitPackageResources? Can we see all of it?
GermainZ said:
Where is that code? handleInitPackageResources? Can we see all of it?
Click to expand...
Click to collapse
All source code:
Code:
package com.thanhtx.z1cqse;
import android.content.res.XModuleResources;
import android.util.Log;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
public class ModQuickSettingIcons implements IXposedHookZygoteInit ,IXposedHookInitPackageResources {
private static String MODULE_PATH = null;
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
}
@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.android.systemui")) return;
Log.d("thanhtx", "-----: handleInitPackageResources:");
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
// worked, drag_handle is an icon in system setting menu
resparam.res.setReplacement("com.android.systemui", "drawable", "drag_handle", modRes.fwd(R.drawable.drag_handle));
// worked, stat_sys_alarm is alarm icon shown in notification bar when you turn on alarm clock
resparam.res.setReplacement("com.android.systemui", "drawable", "stat_sys_alarm", modRes.fwd(R.drawable.stat_sys_alarm));
// not work, statusbar_airplane_off, statusbar_datatraffic_off, statusbar_datatraffic_on are icons in quick settings panel (first image in #1)
resparam.res.setReplacement("com.android.systemui", "drawable", "statusbar_airplane_off", modRes.fwd(R.drawable.statusbar_airplane_off));
resparam.res.setReplacement("com.sonymobile.systemui", "drawable", "statusbar_datatraffic_off", modRes.fwd(R.drawable.statusbar_datatraffic_off));
resparam.res.setReplacement("com.sonymobile.systemui.statusbar.tools", "drawable", "statusbar_datatraffic_on", modRes.fwd(R.drawable.statusbar_datatraffic_on));
Log.d("thanhtx", "-----: replace string:");
//resparam.res.setReplacement("com.android.systemui", "string", "status_bar_clear_all_button", "xxx");
Log.d("thanhtx", "-----: replace string complete:");
}
}
Is there any way to made a custom splashscreen?
Different than the original Asus black and white?
Some way to extract a picture and change it!
Sent by me via my Zenfone
sorry for my maybe bad English
Hello Mattek8,
If you take a look at http://cleanimport.xda/index.php?threads/3385714/ there are splashscreens for ZE500CL.
When you open splash_black.bin and splash_white.bin in a hexadecimal editor, they are flashable images with a so-called OSIP header (fake mbr)
References:
https://github.com/venue3x40-dev/android_device_dell_venue3x40-common
https://github.com/quanganh2627/libintelprov.git
Credits to @social-design-concepts @vampirefo @nels83 and others for the research & hard work.
The OSIP payload is a single OSII image
type 04 : signed splashscreen, for splash_black.bin
type 05 : unsigned splashscreen, for splash_white.bin
If you extract and look at the payload:
Black:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
White:
At offset 0x25 you have a FI marker. Other possible markers are the BMN ones towards the end of file.
At offset 0x2D you have image dimensions: D0-02-00-05
0x2D0 = 720 (width)
0x500 = 1280 (height)
If you examine a ze551ml splashscreen img (dumped from /dev/block/by-name/splashscreen), you will not find the MSIF image/container, nor the BMN markers,
but you will find the FI marker using the image dimensions 38-04-80-07 (0x438 = 1080, 0x780 = 1920)
Still in the MSIF container, around offset 0x40, you see a lot of triplets FF-FF-FF FD-FD-FD : they are probably colors forming the image palette (24 bits with no alpha channel)
@ 0x43 : 00-01 might be the number of palette entries. It is often 0x100 = 256 indexed colors.
I leave the rest to you as an exercise. If you are not skilled enough to crack this, I suggest you ask video game file format reverse engineers: they constantly meet with this kinds of problems. (Xentax, /r/REGames, romhacking.net to name a few)
Good luck!
Direct share not available; more importantly, suggested apps don't reflect apps I use in any way.
I'm using regular apps such as WhatsApp/Telegram and everything worked fine before Android 10.
I did a factory reset, it didn't help. The phone isn't rooted.
Some of the logcat messages:
Code:
2020-04-23 02:53:14.633 1568-4216/? I/ActivityTaskManager: START u0 {act=android.intent.action.CHOOSER flg=0x1 cmp=android/com.android.internal.app.ChooserActivity clip={text/uri-list U:content://com.brave.browser.FileProvider/BlockedFile_4075185958965} (has extras)} from uid 10162
2020-04-23 02:53:14.650 1568-4216/? I/ActivityTaskManager: The Process android:ui Already Exists in BG. So sending its PID: 5428
2020-04-23 02:53:14.652 5428-5428/? W/ActivityThread: handleWindowVisibility: no activity for token [email protected]
2020-04-23 02:53:14.682 5428-5428/? W/ContextImpl: Failed to ensure /data/system/shared_prefs: mkdir failed: EACCES (Permission denied)
2020-04-23 02:53:14.671 5428-5428/? W/android:ui: type=1400 audit(0.0:3956): avc: denied { write } for name="system" dev="mmcblk0p69" ino=671745 scontext=u:r:system_app:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0
2020-04-23 02:53:14.713 5428-5428/? W/View: requestLayout() improperly called by android.widget.ListView{b7f170c VFED..C.. ......ID 0,2160-1080,4005 #10203e7 android:id/resolver_list} during layout: running second layout pass
2020-04-23 02:53:15.189 5428-5428/? W/APSResolverComparator: Score requested for unknown component.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I must admit it seems like widespread issue, seen it also on oneplus forum, also on reddit with pixel phones... Also an android 10 issue only, but with so many complaints, seeing no fix or even response, is very weird...
Hello, I'm attempting to follow the Google birthday card tutorial. When it comes time to extract hardcoded strings into a resource file, upon clicking the quick fix to do so no dialog shows up as is shown in the tutorial. Please see the image I've attached showing where I mean. Is there something that I must do in order to get this to work? I've made sure it's enabled under Help -> Find action, and I've tried restarting Android Studio.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thanks for helping
It seems I've just resolved this issue by first clicking the "Open Editor Preview" button (shown in the attached screenshot) and then clicking the "Extract string resource" option.
1) Kindly go to the Code view so that it brings up the code for the corresponding design, that is in the Design view. You should see these options (Code, Split, Design) at the top right corner of the Layout Editor. Click on Code.
2) Locate the text in the TextView, you want to extract to a string resource.
3) Click anywhere in the hardcoded string or text e.g. 'From Sam' and press ALT+Enter.
You'll see the Extract String Resource option comes up. Click this option, and the Extract Resource dialog will pop up.
I had the same issue and this link from Google helped me. Good luck!
This error usually occurs whenever You are using some special character in your native files especially if you are using ! or ‘ directly then you will face this type of error. You have to use a backslash while you are using it ! or ’
' # Dont use this
\' # this is Right
Or You are using ! then
! # Dont use this
\! # this is Right
And now your error will be solved. Read More about this error at Here