Android: It is impossible to input into editText text after crop image - android-edittext

My interface consists of two parts: editText and imageView used to show image
I use intent MediaStore.ACTION_IMAGE_CAPTURE to take photo, then intent com.android.camera.action.CROP is used to crop that photo.
After cropping, Inputting text into editText but can't be performed though keyboard is displayed (sometimes i can input)
If i input text into edit text before cropping, this manipulation is performed normally.
I tried setting focus for editText but this problem was not solved:
editText.setEnabled(true);
editText.requestFocus();
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
Hope for your help.
Thanks !

http://blog.csdn.net/mmorss/article/details/19190833
I found this blog, it says, adding an invisble edittext would fix your problem. And I tried it, success.
Following is how I did it:
I add this extra edittext named et_none:
<EditText
android:id="#+id/et_none"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#drawable/bg_white_box"
android:gravity="top"
android:inputType="textMultiLine"
android:padding="10dp" />
After crop, I add this code:
et_none.requestFocus();
And this bug never appear.
This bug only appear on Htc G11 at about every two times.

Related

How to show loading spinner in activity while this activity is loading(Xamarin.Android)?

I have the following MainActivity
When I click its GO TO SECOND ACTIVITY button I go to SecondActivity but as in SecondActivity I have a very big zoomable image, the application stays on MainActivity for about 2, 3 seconds and then SecondActivity opens. Тo prevent the user from thinking that the GO TO SECOND ACTIVITY button doesn't work, I want to open SecondActivity as soon as the user presses GO TO SECOND ACTIVITY button and show а loading spinner in place of the image while the image is loading.
Here is my SecondActivity.axml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageLoadingDemo.ScaleImageView
android:src="#drawable/ic_map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
you first add a nuget pack like "urlimageviewhelper", that works fine for me
then use this code instead common way
Koush.UrlImageViewHelper.SetUrlDrawable(ImageViewSample, "ImageUrl", Resource.Drawable.Preloaing, IntNumber);
in the above code use 600000 for 10 minus cache Imgae
Resource.Drawable.Preloaing: it's preload image
So the activity loads fast and image show after loading

Keyboard push the whole content to black background (cordova+framework7+vue)

I have input in toolbar bottom. When keyboard comes up, the content somehow is pushed to (too) top and appear to have black background.
I have
cordova.plugins.Keyboard.shrinkView(true)
cordova.plugins.Keyboard.disableScroll(true)
cordova.plugins.Keyboard.hideFormAccessoryBar(true)
Here is the spec:
cordova 8.0.0
cordova-plugin-keyboard 1.2.0 "Keyboard"
<engine name="ios" spec="^4.5.5" />
Example of bug https://imgur.com/a/SC10ziJ
This might a be problem of organising page contents that does not fit vertically into viewport. As an work around try scroll it to original position by the time keyboard appears. (Example code is below)
$("#SearchInput").focus(function(){
window.scrollTo(0,0);
});

Change background color of a card when the element in the card is being focused

I am using Ant Design and I am new to it. In my case, there are many input components inside a card component. I would like to change the card background color when any input component inside the card is being focused.
I would like to see if there is a simple way to do so, or I have to write JavaScript functions for this case.
I am appreciate with any help on this case. It is grateful if any sample code can be provided. Thank you very much.
P.S. I am able to change the background color of the card. But I cannot find any API on card component which provide this kind of function.
Use CSS trick like following
CSS
.highlight:focus-within {
background: #a1c084;
}
JS
<Card title="Card Name" className="hightlight">
<Input placeholder="Your Input" />
</Card>
I hope this would help
Code Pen : https://codepen.io/shreyans-shrivastav/pen/LawoYE

WiX/Msi textbox border covered up by background image if text is too long

I have an edit control on my custom dialog, that defaults to a session property SERVICE_URL.
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
If the text fits the textbox, everything looks alright, if the text is too long however, the border goes missing. If the user adds/removes text (once the dialog is shown), that doesn't change the appearance, only the initial length has an effect.
Using Multiline="yes" does not help, the text is never wrapped and there is no border either.
How can I keep the border even if the text is too long? I'm using WiX Toolset v3.8.
EDIT: The background plays a role, as Buzka suggested (notice the background "crowding in" when the text is too long). Clearly a bug. Any ideas how I can get it to work short of removing the background?
That's how I have created the different background:
<Binary Id="dialogBackground" SourceFile="Resources\WixUIDialogBackground.png"/>
<Control Id="background" Type="Bitmap" Text="dialogBackground" Width="370" Height="243" X="0" Y="53" TabSkip="no" />
<Control Id="explanationLabel" X="135" Y="23" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="215" Height="100" Text="Please provide the URL of the SettingsService. If you prefer, you may change it at a later stage in the Settings." />
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
I'm using v3.8 too, don't have that problem in my installer. I can see you use custom background color, maybe thats reason?
#Edit
I mean maybe you should set custom border to textbox too? Or try with default backgroud color.
#Edit
After LOOOOONG searching... i found something like this:
Unfortunately, that's how MSI draws it. There's no concept of a custom
control in MSI UI, so there's nothing WiX can do to fix it.
So i think my answer was good, no chances to change it, cause it's not supported.

How to use multiline textview with scrollbars in monodevelop/monoandroid

I am new in monodevelop/monoandroid.I need code for showing multiline text in textview I have tried bellow but still its not working.I think there should be some code that I have to include in .cs file,but I am not getting what to use there.
I have used c# code also but its not working. I think ellipsize is a android attribute thats why its not working.Please give me some solution.
<ScrollView
android:id="#+id/scrollView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="10dip"
android:orientation="vertical"
android:layout_gravity="center" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_marginTop="10dip">
<TextView
android:id="#+id/tv_policy1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:text="Terms of Service O-job Information Terms of Service O-job Information Terms of Service O-job Information Terms of Service O-job Information for Personal non-commercialaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa use only sdfjkj asdfjklfj sdfjkljdf sdfjkljflkj sdfskjfkl sdfjklsdjf sdfkljsdklfj sdfjhsdkfh"
android:textColor="#000000"
android:maxLines="3"
android:singleLine="false"
android:textSize="14dip" />
</RelativeLayout>
</ScrollView>
Please advice....
Thanks in advance!
Try this format:
<ScrollView>
<RelativeLayout>
<TextView/>
<TextView/>
<RelativeLayout/>
<ScrollView/>
Then you can use the align methods given in a RelativeLayout.
Edit:
Explain what your problem is! Do you get an error when compiling or is the text not shown properly? Be more specific.
Also, why do you use attributes like : android:maxLines="3" or android:singleLine="false" or android:layout_height="60dip" in your TextView. Translated this means: The text must have more than one line but a maximum of 3. Also it can't be longer than 60dip.
Depending on the Text that are very strict rules. Use these rules android:layout_width="match_parent" android:layout_height="wrap_content" to make sure that the text can be displayed correctly, remove the attributes I mentioned before in your TextView.

Resources