using Default system Keypad and recreating only Keypad necessary - tabwidget

I have a requirement to create a Keypad as follows
1) only Edit Text is Visible Initially
2) on click of the Edit Text launches a tabwidget/Buttons/ImageView and the first tab of the Widget contains the Default system keypad and rest of the tabs contain the Custom Keypad.
3) The EditText appears on top of the Keypad and the tabWi
I tried using the SCrollView as mentioned below
I have the following XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true">
<EditText
android:id="#+id/editview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:ems="10"
android:inputType="text"/>
</ScrollView>
<RelativeLayout
android:id="#+id/relView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="-8dip ">
<ImageView
android:id="#+id/button1"
android:src="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="-8dip"
android:layout_marginLeft="-8dip" />
<ImageView
android:id="#+id/button2"
android:src="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/button1"
android:adjustViewBounds="true"
android:layout_marginRight="-8dip" />
<ImageView
android:id="#+id/button3"
android:src="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/button2"
android:adjustViewBounds="true"
android:layout_marginRight="-8dip" />
<ImageView
android:id="#+id/button4"
android:src="#drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/button3"
android:adjustViewBounds="true"
android:layout_marginRight="-8dip" />
</RelativeLayout>
</RelativeLayout>
This way it launches the Keypad and the Image View is visible at the bottom of screen
by setting android:windowSoftInputMode="stateAlwaysHidden|adjustResize|adjustPan"
But i want to get only ImageView and the Keypad on click of EditText & Edit Text should be on top of the Keypad.

Related

google.android.material.bottomappbar resourse linking failed

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="#c4c4c4">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="#+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:background="color/white"
app:fabCradleRoundedCornerRadius="10dp"
app:fabCradleMargin="4dp" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottomNavigationView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:menu="#menu/bottom_menu"
android:background="#android:color/transparent"
android:layout_gravity="bottom"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="90dp"
android:layout_height="90dp"
android:backgroundTint="#color/white"
android:src="#drawable/qr"
app:fabCustomSize="90dp"
app:layout_anchor="#id/bottomAppBar"
app:maxImageSize="40dp"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.bottomappbar >this part error occured
the error is
"Android resource linking failed"
what can i do ???
i tried to fix <build.gradle>
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
someone tell that can be fixed when i downgrade material version
but it's not..

How to place your ads at the bottom of your screen in Android

I want to place ad banner startapp at bottom of screen. it keeps appears on the top . i want it to be in the buttom of the screen you find my code down here ..
I am trying to position the ad at the bottom of the screen but nothing I try seems to work.
Below is the XML code for the layout thanks a lot .
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/pictureone"
tools:context="org.sna.myapplication.MainActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#mipmap/pictureone"
android:weightSum="10"
android:clickable="false">
<TextView
android:layout_width="340dp"
android:layout_height="wrap_content"
android:text="click NEXT to start the application"
android:id="#+id/textView3"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="30dp"
android:layout_weight="1.58"
android:textAlignment="center" />
<ImageView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/imageView6"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#mipmap/oussama"
android:layout_marginTop="1dp"
android:clickable="true"
android:onClick="next" />
</LinearLayout>
<com.startapp.android.publish.ads.banner.Banner
android:id="#+id/startAppBanner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>
Place the banner within your LinearLayout
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#mipmap/pictureone"
android:weightSum="10"
android:clickable="false">
<TextView
android:layout_width="340dp"
android:layout_height="wrap_content"
android:text="click NEXT to start the application"
android:id="#+id/textView3"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="30dp"
android:layout_weight="1.58"
android:textAlignment="center" />
<ImageView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/imageView6"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#mipmap/oussama"
android:layout_marginTop="1dp"
android:clickable="true"
android:onClick="next" />
<com.startapp.android.publish.ads.banner.Banner
android:id="#+id/startAppBanner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="0dp" />
</LinearLayout>

Not able to show image on dialog box in AEM

I am trying to create a dialog with image preview on it. I am able to create dialog with all the fields but i am facing issue with image. I have seen the image component where you can drag drop image but i need the image to be shown when i open dialog component. Is there any component for this without drag drop.
I have tried with html5smartimage image but not working. Please see code below:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}500"
title="Test Dialog"
width="{Long}800"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Component Details">
<items jcr:primaryType="cq:WidgetCollection">
<image
jcr:primaryType="cq:Widget"
cropParameter="./imageCrop"
ddGroups="[media]"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
mapParameter="./imageMap"
name="./file"
requestSuffix=".img.png"
rotateParameter="./imageRotate"
title="Image"
xtype="html5smartimage">
<icon.png jcr:primaryType="nt:file">
<jcr:content
jcr:data="{Binary}"
jcr:lastModified="{Date}2015-07-28T19:27:46.878+05:30"
jcr:lastModifiedBy="admin"
jcr:mimeType="image/png"
jcr:primaryType="nt:resource"
jcr:uuid="754c14c8-4423-45df-b982-06bfc13dc6e3"/>
</icon.png>
</image>
</items>
</tab1>
</items>
</items>
</jcr:root>
Please help me out on this.
I don't think there is a need to use the html5smartimage if all that you want to do is, display a static image in the dialog (which needn't get submitted too).
You can make use of the xtype displayfield and use the html property as shown below.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}500"
title="Test Dialog"
width="{Long}800"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Component Details">
<items jcr:primaryType="cq:WidgetCollection">
<displayimage jcr:primaryType="cq:Widget"
html="<img src='/content/dam/geometrixx/icons/target.png'>"
xtype="displayfield" />
</items>
</tab1>
</items>
</items>
</jcr:root>
Replace the image src with the path to your image which you want to display in the dialog.

Hide reorder button in a multifield

I have a dialog with a multifield with custom xtype. As per the requirement, I don't require the re-ordering functionality of the multifield elements. Is there a way to hide these buttons.
Dialog xml is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}800"
width="{Long}1200"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tabs
jcr:primaryType="cq:Panel"
title="Questions & Answers">
<items jcr:primaryType="cq:WidgetCollection">
<tabs
jcr:primaryType="cq:Widget"
addItemLabel="Add a question"
fieldDescription="Note:
1. Add the questions first in a row.
2. Please select answer type before start adding the answers."
name="./questionStack"
xtype="multifield">
<fieldConfig
jcr:primaryType="nt:unstructured"
xtype="apps.nirmal.widgets.configurableQandAfield"/>
</tabs>
</items>
</tabs>
</items>
</items>
</jcr:root>
Just check the API documentation at https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html
There you see a boolean property in the Multifield configuration properties to disable ordering:
orderable : Boolean
If the list of fields should be orderable and Up/Down buttons are
rendered (defaults to true).

Images are not displayed on the buttons

I use the Fluent Ribbon (fluent.codeplex.com). I want to arrange four buttons side by side.
I use the following code:
<Fluent:RibbonGroupBox Header="Some Header">
<Fluent:RibbonToolBar>
<Fluent:RibbonToolBar.LayoutDefinitions>
<Fluent:RibbonToolBarLayoutDefinition Size="Small">
<Fluent:RibbonToolBarRow>
<Fluent:RibbonToolBarControlGroupDefinition>
<Fluent:RibbonToolBarControlDefinition Target="buttonFirst" />
<Fluent:RibbonToolBarControlDefinition Target="buttonPrevious" />
<Fluent:RibbonToolBarControlDefinition Target="buttonNext" />
<Fluent:RibbonToolBarControlDefinition Target="buttonLast" />
</Fluent:RibbonToolBarControlGroupDefinition>
</Fluent:RibbonToolBarRow>
</Fluent:RibbonToolBarLayoutDefinition>
</Fluent:RibbonToolBar.LayoutDefinitions>
<Fluent:Button Size="Small" Icon="/WpfApplication1;component/Resources/First_16.png" x:Name="buttonFirst" />
<Fluent:Button Size="Small" Icon="/WpfApplication1;component/Resources/Previous_16.png" x:Name="buttonPrevious" />
<Fluent:Button Size="Small" Icon="/WpfApplication1;component/Resources/Next_16.png" x:Name="buttonNext" />
<Fluent:Button Size="Small" Icon="/WpfApplication1;component/Resources/Last_16.png" x:Name="buttonLast" />
</Fluent:RibbonToolBar>
</Fluent:RibbonGroupBox>
The buttons are aligned correctly, but the buttons don't have a image. Where is the problem?
(The image files are available)
Sometimes you need to change 'Copy to Output Directory" setting. I usually use 'Always'. Or IfNewer if you have a lot and don't want a rebuild to constantly wipe and recopy.

Resources