"andr" tab completes to "_xrandr" instead of android or nothing - android

I am running osx and installed oh-my-zsh as well, if that's relevant.
Anyway, if I type in something like "andr" and hit tab to complete it, it autocompletes to _xrandr instead of doing nothing (android isn't in my path). I'm not really sure why.
Any idea why that might be the case?

oh-my-zsh sets up completion to look for completions on the left side of the typed word if there are none on the right side.
This happens in ~/.oh-my-zsh/lib/completion.zsh:
## case-insensitive (all),partial-word and then substring completion
if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset CASE_SENSITIVE
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
fi
The important part here is 'l:|=* r:|=*'. If you dislike this behavior, you just have to remove this from zstyle ':completion:*' matcher-list. The best way to do this, is to create a file in ~/.oh-my-zsh/custom with extension .zsh, for example own-completion.zsh:
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*'
This is for case insensitive completion, if you do not want this either, also remove 'm:{a-zA-Z}={A-Za-z}'.
You could change it in ~/.oh-my-zsh/lib/completion.zsh directly, but it will probably be overwritten once you update oh-my-zsh.

Related

KivyMD, can't see icons in android but works on linux

I'm just created .apk file with buildozer.But as i said in topic, can't see any icon on device.Everything works and looks fine in Linux. But in device,all icons are blank. This is my buildozer.init requirements: (my ndk,sdk,minapi,ndk_api values are default)
requirements = python3,kivy==1.11.1,https://github.com/kivymd/KivyMD/archive/master.zip
If i use kivymd==0.104.1, i can see icons in android but can't use some commands like : MDTab.get_tab_list() , MDTab.switch_tab() (I asked that problem before in here.So i have to use master branch version because i need to switch MDTabs after some button clicks.But now,i can't see any icon.Is that bug or can someone help me ? Thank you..
(Last note: Im removing .buildozer file before change requirements versions.)
Set correct dependencies in buildozer.spec- https://github.com/kivymd/KivyMD/commit/df73810cc725e4575c93bc4cbbb72f67ff568dc1

SDL keeps failing to find font on Android

When I attempt to deploy my app using Eclipse it throws FileNotFoundException on my font, which I've now copied to both the assets/src and assets directory to be doubly sure.
I had this problem before, after succesfully integrating SDL_ttf into my Visual C++ build of the same app and transferring across to Eclipse for Android. Now I'm facing it again I thought I better write about it. The SDL_ttf source comes with a freetype folder already in place and referenced by android as external/freetype-2.4.12. DinoMage states I need to download this separately although he refers to freetype-2.4.11 being the latest. That's the only obvious difference from my VC build, apart from minor compiler intolerances.
I've got it working a bit now. I can sign the app (unsigned didn't work), disable USB debugging, and it will load the font and display a menu. From there it breaks, again, so I can't see how I'm supposed to debug it further. I'm sure I'll fix it somehow. But I'll also forget the obscura if I don't post here.
I don't know much about using the debugger with Android, but I can make suggestions otherwise.
Is your assets path really named "assetts"? If possible, I'm not sure how one would get Android and SDL to look there instead of "assets".
SDL and it's friend libs like SDL_ttf search for files local to the assets directory first and then search relative to the root directory. So I would expect that your "res/stubbornFont.ttf" will never load because it is in the resources "res" directory and SDL_ttf will not look there.
Maybe you can specify it relative to assets/, like "../res/stubbornFont.ttf", but I haven't tested that. It would work if you put the font in assets/ and loaded it as "stubbornFont.ttf".
I've think I've got closure on this.
It is possible to debug the app. By continuing it will trap several times trying to load one font. I think it stops eventually, I'm not sure. I've stepped through it from where it lands me at the throw stage. However single stepping from there begins from the synchronized statement, sorry it's Java but from my quick reference to What does 'synchronized' mean? I think this is a race condition
public final AssetFileDescriptor openFd(String fileName)
throws IOException {
synchronized (this) {
if (!mOpen) {
throw new RuntimeException("Assetmanager has been closed");
}
ParcelFileDescriptor pfd = openAssetFd(fileName, mOffsets);
if (pfd != null) {
return new AssetFileDescriptor(pfd, mOffsets[0], mOffsets[1]);
}
}
throw new FileNotFoundException("Asset file: " + fileName);//DEBUGGER traps here
}
You might be there all day single stepping that! It appears to perform all steps required of it and finally I land in:
public static ReadableByteChannel newChannel(InputStream inputStream) {
return new InputStreamChannel(inputStream);
}
No, not finally, lastly, there is
public static Context getContext() {
return mSingleton;
}
In the SDLActivity I extend.
That has a bunch of members I don't want to know about:
Luckily I discovered I can selectively "Disconnect" using a button in eclipse two along from debug/run. It has no keyboard shortcut and I'm not sure why but it will reconnect when I next trigger an exception. This is debugging as I know and love it in Android and Eclipse, still probably easier than GDB.
For arguments sake I've even replaced:
//TTF_Font *gFont = TTF_OpenFont( "res/stubbornFont.ttf", 160 );
with
TTF_Font *font=TTF_OpenFontRW(SDL_RWFromFile("res/stubbornFont.ttf", "rb"), 1, 160);//Same difference
UPDATE/EDIT
Here is the solution I was really looking for,
turning off uncaught exceptions in eclipse, it really is just that, Window->Preferences->Java->Debug and it's the very first box at the top for me.

Eclipse LogCat shows only the first letter from each message

I installed android SDK and plugin on eclipse 4.4, and LogCat shows only the first letter from each message.
an screenshot:
The problem is probably in eclipse as I can see the LogCat well while running 'adb logcat'.
I tried to restart eclipse, adb, and changing LogCat fonts.
Here is how to fix it:
exit eclipse
open up the file
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
Then cut and paste this in over the existing
ddms.logcat.automonitor.level=error
ddms.logcat.automonitor=false
ddms.logcat.automonitor.userprompt=true
logcat.view.colsize.Level=54
eclipse.preferences.version=1
logcat.view.colsize.Application=169
logcat.view.colsize.Time=156
logcat.view.colsize.Tag=124
logcat.view.colsize.PID=54
logcat.view.colsize.Text=590
Restart eclipse
I'm creating a new answer since I don't have enough rep to comment on #claganga, that is , modifying the file on workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
I'm using Eclipse Mars M4 and after trying the solution above with some variations I still could see a single column - although I could change from the single letter from debug level to TID's 4 digits.
However after having tried the following I got an important improvement:
ddms.logcat.auotmonitor.level=error
ddms.logcat.automonitor=false
ddms.logcat.automonitor.userprompt=true
eclipse.preferences.version=1
logcat.view.colsize.Application=169
logcat.view.colsize.Level=54
logcat.view.colsize.PID=54
logcat.view.colsize.Tag=198
logcat.view.colsize.Text=619
logcat.view.colsize.Time=182
I'm not sure if it was moving the version line up, or removing the trailing spaces, but it started making a difference.
Now I can see Level, Time, PID, Application, Tag and Text. I'm not sure how they're supposed to change their order, but at least I can resize them with a mouse now.
However I noticed the horizontal scroll bar is still completely stuck to 100%, meaning what's out of sight is out of reach. Anyway, it's good enough for me right now.
Some important things I noticed: a) don't leave trailing spaces in any of those lines - when I copy/pasted there were some. And b) order is important , though I don't know why or how.
I had the same problem on Eclipse 4.5.0(Mars Release), i tried #claganga 's solution but didn't work for me at first.
Here is my addition to the solution that worked for me :
Exit eclipse
Open up the file
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
Just add those lines save, close it. Restart eclipse, wait for it until loading workspace. Then Exit.
ddms.logcat.auotmonitor.level=error
ddms.logcat.automonitor=false
ddms.logcat.automonitor.userprompt=true
logcat.view.colsize.Level=54
eclipse.preferences.version=1
Open up the file at step 2 again, add the lines below step 5 one at a time. After adding one line save&close it. Restart eclipse, wait for it until loading workspace. Then Exit.
Repeat the process at step 4 again for the second line, third line etc.
logcat.view.colsize.Application=169
logcat.view.colsize.PID=54
logcat.view.colsize.Tag=198
logcat.view.colsize.Text=619
logcat.view.colsize.Time=182
Like #Fabio says, don't leave trailing spaces in any of the property lines.
This is very important!!!
After ensuring that, you can customize the colsize of each col of these(I don't know if there're others, but I've met only these):
logcat.view.colsize.Application
logcat.view.colsize.Level
logcat.view.colsize.PID
logcat.view.colsize.TID
logcat.view.colsize.Tag
logcat.view.colsize.Time
logcat.view.colsize.Text
You don't need to care about the order of these properties because eclipse will sort them according to the alphabet.
I don't know the situations in the other systems or machines, but in my Ubuntu system, the minimum sum of all colsizes is 942. And you can set your colsize beyond that which will cause the horizontal scroll bar to display not 100%.
Hope my advice can help someone:)
If you use Eclipse Andmore the file for this problem is:
org.eclipse.andmore.ddms.prefs
For me all solutions worked after adding the attribute:
logcat.view.colsize.Text
If it was missing, only the level was shown. This attribute is missing in the marked correct answer.
Just edit the file below:
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
Would u please try this out:
please delete the spaces at the end of each line ,it will work.
(Most importantly, make sure there is not any space at the end of each line):
com.android.ide.eclipse.ddms.adbDebugBasePort=8600
com.android.ide.eclipse.ddms.explorer.info=68
com.android.ide.eclipse.ddms.explorer.name=94
com.android.ide.eclipse.ddms.explorer.permissions=68
com.android.ide.eclipse.ddms.explorer.size=44
com.android.ide.eclipse.ddms.explorer.time=34
ddms.logcat.auotmonitor.level=error
ddms.logcat.automonitor=false
ddms.logcat.automonitor.userprompt=true
devicePanel.Col0=319
devicePanel.Col1=38
devicePanel.Col4=61
eclipse.preferences.version=1
emulatorControl.track.name=155
emulatorControl.waypoint.name=95
heapPanel.col0=1276
logcat.view.colsize.Application=133
logcat.view.colsize.Level=44
logcat.view.colsize.PID=44
logcat.view.colsize.TID=44
logcat.view.colsize.Tag=98
logcat.view.colsize.Text=712
logcat.view.colsize.Time=131
logcat.view.filters.list=name\: 'com.android.settings', tag\: '', text\: '', pid\: '', app\: 'com.android.settings', level\: 'verbose', name\: 'ActivityManager', tag\: 'ActivityManager', text\: '', pid\: '', app\: '', level\: 'verbose',
logcat.view.font=1|Sans|11.0|0|GTK|1|;
threadPanel.Col0=24
threadPanel.Col1=37
threadPanel.Col2=61
threadPanel.Col3=34
threadPanel.Col4=34
threadPanel.Col5=272
threadPanel.stack.col0=503
These are not the first letters from the messages.
These are the level flags: V (for verbose), D (for debug), etc.
Do you see that bottom scroll bar? Scroll it to the right.
Then resize the columns by clicking and dragging the separator between the headers. Do not grab the separator between the column themselves where the content is, grabbing there won't work. Also, you must reduce the size of the first column to make room for the others. And right-click on the header itself to add/remove columns.
goto your logcat move your bottom scroll bar towards right then on top you can drag your LEVEL section towards left and make room for other section it will surely work
The settings that worked for me are the following:
ddms.logcat.auotmonitor.level=error
ddms.logcat.automonitor=true
ddms.logcat.automonitor.userprompt=true
eclipse.preferences.version=1
logcat.view.colsize.Application=169
logcat.view.colsize.Level=54
logcat.view.colsize.PID=54
logcat.view.colsize.Tag=198
logcat.view.colsize.Text=676
logcat.view.colsize.Time=156
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
I replaced/overwrote the com.android.ide.eclipse.ddms.prefs file:
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
with one from a previous Eclipse installation. It worked. This is the content:
com.android.ide.eclipse.ddms.explorer.data=82
com.android.ide.eclipse.ddms.explorer.info=1193
com.android.ide.eclipse.ddms.explorer.name=663
com.android.ide.eclipse.ddms.explorer.permissions=94
com.android.ide.eclipse.ddms.explorer.size=58
com.android.ide.eclipse.ddms.explorer.time=46
ddms.logcat.auotmonitor.level=error
ddms.logcat.automonitor.userprompt=true
devicePanel.Col0=378
devicePanel.Col1=56
devicePanel.Col4=1273
eclipse.preferences.version=1
logcat.view.colsize.Application=98
logcat.view.colsize.Level=67
logcat.view.colsize.PID=54
logcat.view.colsize.TID=54
logcat.view.colsize.Tag=168
logcat.view.colsize.Text=1001
logcat.view.colsize.Time=196
1) exit eclipse
2) open up the file
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.ddms.prefs
3) Input false vlaue for your arbitrarily parameters

How to find a WebView element in Android using Calabash using TextContent

I have a webview in an ios app that basically has no id or class. (I know, right?)
But it does have a textContent field that I would like to use to select elements.
This is the element I want to find:
{"rect"=>
{"center_x"=>307.5,
"left"=>295,
"bottom"=>136,
"right"=>320,
"top"=>93,
"width"=>25,
"height"=>43,
"center_y"=>178.5},
"nodeName"=>"LI",
"id"=>"",
"textContent"=>"!!! I WANT TO FIND IT BY THIS !!!",
"center"=>{"X"=>307.5, "Y"=>178.5},
"nodeType"=>"ELEMENT_NODE",
"webView"=>
"<UIWebView: 0xe2e1400; frame = (0 0; 320 504); clipsToBounds = YES; autoresize = W+H
"class"=>"arrow",
"html"=>"<div class=\"arrow\"></div>"}
So I was able to find this using css pseudo-selectors alá
query("webView css:'el:first-child'")
I can find it by using the hashes in the results array alá
query("webView css:'li'").select {|element| element["textContent"] == "!!! I WANT TO FIND IT BY THIS !!!}
And I can refactor it a bit to use a regex alá
query("webView css:'li'").select {|element| element["textContent"] =~ /I WANT/}
But all this feels really dirty. Very un-Calabashy. Is there a better way to write this?
I have not tried your exact setup. But I do often use queries with the LIKE comparison on label.
Would that solve your problem?
ex.
element_exists("label {text LIKE 'I WANT TO FIND'}")
I wound up going with this:
query("webView css:'TITLE'{textContent CONTAINS ’I WANT’}")
It tends to work more consistently with these particular webviews (given a lack of accessibility labels in the code).

function is not working properly in Qt

I am making a simple GUI program to change bootanimation of a android phone but from last 4 days I am facing a problem and I don't know whats is reason, here is my code
void MainWindow::bootanim1()
{
QProcess rootboot;
QStringList path6,boottarget;
path6<<ui->lineEdit_6->text();
boottarget<<path6<<" /system/media";
ui->textBrowser->clear();
ui->textBrowser->setText("Remounting partitions...");
rootboot.start("bbin\\adb shell su -c \"busybox mount -o remount,rw /system\"");
rootboot.waitForFinished();
ui->textBrowser->setText("\nInstalling bootanimation.zip");
rootboot.start("bbin\\adb push ",boottarget);
rootboot.waitForFinished();
ui->textBrowser->setText("\nBootanimation has been changed! Try shutting down your phone to see new bootanimation");
}
This function is launched when a button is clicked but my problem is, this is not working! Secondly you can see in the code that to be more informative I have used a textBrowser to show user whats going on like Remounting partitions etc and the lineEdit_6 is the lineEdit widget where user will paste the path of the bootanimation.zip. So my problem is when I click the button only this is shown
Bootanimation has been changed! Try shutting down your phone to see new bootanimation
And everything above it I think is getting skipped, I don't know why? can anyone give me some hint on what I am missing?
Here you are mixing two different methods to give arguments to QProcess:
boottarget<<path6<<" /system/media";
rootboot.start("bbin\\adb push ",boottarget);
First method gives the program name and arguments in one QString.
Second method gives the arguments in a QStringList.
You are trying to give one argument ("push") in the program name string. It doesn't work, when the other arguments are given in a QStringList. The last argument also contains suspicious looking space in the beginning, although I don't know if it causes problems. Try this instead:
QStringList args;
args << "push" << path6 << "/system/media";
rootboot.start("bbin\\adb", args);
And path6 variable probably should be QString instead of QStringList.
Ui requires eventloop to refresh itself. When you do all changes in one function call, then only internal property change, and gui itself doesn't repaint. Use QCoreApplication::processEvents(); right after each ui->textBrowser->setText(...);

Categories

Resources