Fórum

How to create and use a Child view or Extended view ?

Amit Sinha, modificado 7 Anos atrás.

How to create and use a Child view or Extended view ?

Junior Member Postagens: 43 Data de Entrada: 31/12/14 Postagens Recentes
Hi Everyone,
How to modify the theme of LoginScreenlet screenlet.
I went through link for creating view and tried creating "Child View".
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-android-views

Created login_contact.xml , but do not know where to write below code
liferay:layoutId="@layout/login_compact".
Is there any more link or resource
Waiting for guidance.

Thanks and Regards,
Amit.
thumbnail
Victor Galan, modificado 7 Anos atrás.

RE: How to create and use a Child view or Extended view ? (Resposta)

Regular Member Postagens: 144 Data de Entrada: 14/06/16 Postagens Recentes
You have to put it in the screenlet declaration in your activity layout

for example:

<com.liferay.mobile.screens.auth.login.loginscreenlet android:id="@+id/login_screenlet" android:layout_width="match_parent" android:layout_height="match_parent" app:layoutid="@layout/login_compact" < code></com.liferay.mobile.screens.auth.login.loginscreenlet>
<br><br>I hope it helps<br><br>Regards,<br><br>Victor
Amit Sinha, modificado 7 Anos atrás.

RE: How to create and use a Child view or Extended view ?

Junior Member Postagens: 43 Data de Entrada: 31/12/14 Postagens Recentes
Thanks Victor Galan for your guidance.

It worked.
i was confused by 'Activity' word of below statement and trying to insert it, in Activity instead of Layout.
'For example, to use the new login_compact layout, insert LoginScreenlet in an activity or fragment and set liferay:layoutId="@layout/login_compact".'

One more Question
i want to replace icons ie. "default_mail_icon" & "default_lock_icon" with my new icons
Where to keep these new icons in the app,
as the orignal icon are not kept in any folder (drawable folder) of app, but just mentioned as below

android:drawableLeft="@drawable/default_mail_icon"
android:drawableLeft="@drawable/default_lock_icon"

Thanks and Regards,
Amit.
Amit Sinha, modificado 7 Anos atrás.

RE: How to create and use a Child view or Extended view ?

Junior Member Postagens: 43 Data de Entrada: 31/12/14 Postagens Recentes
Hi,
I found location of Icons.
Normally they are not seen in Component Tree's selected 'properties section' of design part of layout xml file
but if below code is written in layout xml file
android:drawableLeft="@drawable/default_mail_icon"
then
The Icons can be found in Component Tree's Properties section with property name as 'drawableLeft' in design part of layout xml file
If property 'drawableLeft' is clicked, then a pop-up menu (named as "Resource") is displayed from where other icon can be selected.
But this newly selected icon is not displayed when app runs.

Similarly when a new icon (let test-icon.png) is added in Resource pop-up menu and then selected
This new icon is also not displayed in running App

Am i missing something or
Does this part should be searched in Android forum ?

Thanks and Regards,
Amit.
thumbnail
Victor Galan, modificado 7 Anos atrás.

RE: How to create and use a Child view or Extended view ?

Regular Member Postagens: 144 Data de Entrada: 14/06/16 Postagens Recentes
That resources are packaged with the library,
If you want to change it you only have to open your new layout xml and replace

android:drawableLeft="@drawable/default_mail_icon"
with
android:drawableLeft="@drawable/drawable_you_want"

I hope it helps,
Regards,
Víctor