5,606,151 Members 34,703 Now Online
XDA Developers Android and Mobile Development Forum

[HOW TO] Create your own Android Launcher (Video Series)

Tip us?
 
powerpoint45
Old
#51  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1728
Posts: 1,907
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Quote:
Originally Posted by zalzondabuzz View Post
oum, i'll upload mysource into git now.

---------- Post added 3rd February 2014 at 12:05 AM ---------- Previous post was 2nd February 2014 at 11:25 PM ----------

here's my source..
https://github.com/zalzondabuzz/one_launcher/
In your AppTouchListener on your line
Quote:
LayoutParams lp = new LayoutParams(iconSize, iconSize);
change it to
Quote:
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(iconSize, iconSize);
Your import is what screwed you over
Quote:
import android.app.ActionBar.LayoutParams;
<<this is wrong import


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
The Following User Says Thank You to powerpoint45 For This Useful Post: [ Click to Expand ]
 
powerpoint45
Old
#52  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1728
Posts: 1,907
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Quote:
Originally Posted by aureljared View Post
Hey @powerpoint45,

I followed your instructions and my project compiled with no errors.
However, it force closes when I run it on my physical device running 4.1.2.

I have attached my project.
I hope you can help me.

Also, are you planning to add a tutorial on how to support widgets and a scroll indicator? Does the resulting launcher have a grid or can icons be freely placed?

Thanks!

Your problem is located inside res/layout/activity_main.xml

Your handle and content is not a child of SlidingDrawer. Here is what you need to change it to

Quote:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:id="@+id/home_view" >

<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"

android:handle="@+id/handle"
android:content="@+id/content" >

<ImageView
android:id="@+id/handle"
android:background="@drawable/webicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<GridView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Black_transparent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="50dp"
android:horizontalSpacing="50dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
</SlidingDrawer>


</RelativeLayout>
Little tip tho; your handle image is very big (;


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
The Following User Says Thank You to powerpoint45 For This Useful Post: [ Click to Expand ]
 
aureljared
Old
#53  
aureljared's Avatar
Senior Member
Thanks Meter 376
Posts: 543
Join Date: May 2013
Location: Quezon City
Quote:
Originally Posted by powerpoint45 View Post
Your problem is located inside res/layout/activity_main.xml

Your handle and content is not a child of SlidingDrawer. Here is what you need to change it to



Little tip tho; your handle image is very big (;
Yes, I saw that
I found a good handle png in my PC somewhere.

Thanks for everything!

Sent from my GT-I8730 using Tapatalk
If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (running CM 10.1 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial Sign/Zipalign Script
Project CyanogenMod: GT-I8730 AOSP Status Bar Icons + 1% Increment Battery MOD
The Following User Says Thank You to aureljared For This Useful Post: [ Click to Expand ]
 
zalzondabuzz
Old
#54  
zalzondabuzz's Avatar
Senior Member
Thanks Meter 534
Posts: 530
Join Date: May 2012
Location: Bandung

 
DONATE TO ME
Quote:
Originally Posted by powerpoint45 View Post
In your AppTouchListener on your line


change it to


Your import is what screwed you over
<<this is wrong import

Working Fine bro...
thx for correcting my source..
The Following User Says Thank You to zalzondabuzz For This Useful Post: [ Click to Expand ]
 
Ashutos1997
Old
#55  
Ashutos1997's Avatar
Senior Member
Thanks Meter 510
Posts: 401
Join Date: May 2012
Location: New Delhi , India
How to add a app drawer in the launcher, i mean how to add five icons in the app drawer ?
Check my other posts at http://www.ugeeky.com
 
aureljared
Old
#56  
aureljared's Avatar
Senior Member
Thanks Meter 376
Posts: 543
Join Date: May 2013
Location: Quezon City
Quote:
Originally Posted by Ashutos1997 View Post
How to add a app drawer in the launcher, i mean how to add five icons in the app drawer ?
Take my recent commit as an example:

I did not like the 2-column grid that the tutorial gave me, so after I experimented a bit, I managed to get a 4-column grid.

activity_main.xml:
You will see that columnwidth was changed to 50dp, verticalSpacing was changed to 35dp, and horizontalSpacing was changed to 30dp.
This narrows the size of each column, and since we set our grid to match the display of the device, it also adds more columns. However, parts of each app icon will be omitted, because of the smaller space. Which leads us to...

drawer_item.xml:
You will see that each item was resized to 50 x 50dp.
In my case, this corrected my issues, and gave me 4 proper columns.

Just experiment with these values in your project until you get a 5-column grid.

Sent from my Galaxy Express using Tapatalk
If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (running CM 10.1 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial Sign/Zipalign Script
Project CyanogenMod: GT-I8730 AOSP Status Bar Icons + 1% Increment Battery MOD
The Following User Says Thank You to aureljared For This Useful Post: [ Click to Expand ]
 
kamranhaghighi
Old
#57  
kamranhaghighi's Avatar
Senior Member
Thanks Meter 6
Posts: 522
Join Date: Apr 2012
Location: Mashhad:\
anything from google else than search is forbidden facebook too !!
Sweet nexus 4, Rooted!
I dont keep a rom for more than a day ! I always try !
 
deathblade
Old
(Last edited by deathblade; 10th February 2014 at 12:54 PM.)
#58  
deathblade's Avatar
Senior Member
Thanks Meter 353
Posts: 1,303
Join Date: Dec 2011
Anyone know how to close the app drawer via back button without refreshing the main activity I'll add a snippet of what I have in place after work, I don't know the exact lines off the top of my head but it does use onbackpressed()

This is what I have in place for closing the drawer when hitting the back button, I know is not the best way to do it but it works... Mostly, this will launch any previous launcher (sometimes app) that was open so close out of everything for it to work right also as stated above it does refresh the while main activity)
Code:
 
 @override

********public void onBackPressed() {

************super.onBackPressed();

************setContentView(R.layout.activity_main);
With out the Asterix


Sent from my Nexus 7 2013 using XDA Premium 4 mobile app
 


Google Nexus 7 (2013)
Rom:Sinless/Vanir (via Multirom)

Samsung Galaxy S III SGH-I747
Rom: Vanir 4.4.2

Samsung SGH-i977 Infuse 4G

LINKS:
MY SLIDING MESSAGING THEMES ARE LOCATED HERE
The Following User Says Thank You to deathblade For This Useful Post: [ Click to Expand ]
 
aureljared
Old
#59  
aureljared's Avatar
Senior Member
Thanks Meter 376
Posts: 543
Join Date: May 2013
Location: Quezon City
Quote:
Originally Posted by deathblade View Post
Anyone know how to close the app drawer via back button without refreshing the main activity I'll add a snippet of what I have in place after work, I don't know the exact lines off the top of my head but it does use onbackpressed()

Sent from my Nexus 7 2013 using XDA Premium 4 mobile app
Yes please
Thanks man

Sent from my Galaxy Express using Tapatalk
If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (running CM 10.1 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial Sign/Zipalign Script
Project CyanogenMod: GT-I8730 AOSP Status Bar Icons + 1% Increment Battery MOD
 
naresh babu
Old
(Last edited by naresh babu; 21st February 2014 at 11:28 AM.)
#60  
Senior Member
Thanks Meter 96
Posts: 170
Join Date: Jun 2013
Location: HYDERABAD
Default Awesome

AweSome Tutorial... Thanks for doing such a great work and helping others especially me..

---------- Post added at 04:46 PM ---------- Previous post was at 04:37 PM ----------

Quote:
Originally Posted by deathblade View Post
Anyone know how to close the app drawer via back button without refreshing the main activity I'll add a snippet of what I have in place after work, I don't know the exact lines off the top of my head but it does use onbackpressed()

This is what I have in place for closing the drawer when hitting the back button, I know is not the best way to do it but it works... Mostly, this will launch any previous launcher (sometimes app) that was open so close out of everything for it to work right also as stated above it does refresh the while main activity)
Code:
 
 @override

********public void onBackPressed() {

************super.onBackPressed();

************setContentView(R.layout.activity_main);
With out the Asterix


Sent from my Nexus 7 2013 using XDA Premium 4 mobile app
setContentView(.......); will only show you the layout but the functionality for the app cannot be done..if you want to make homescreen functionalities work, the whole code must be written again..
better use Intent and startActivity methods inside onBackpressed() method....and launch the homescreen class..
correct me if i am wrong..
Press Thanks if i helped you...

---------- Post added at 04:54 PM ---------- Previous post was at 04:46 PM ----------

Quote:
Originally Posted by Ashutos1997 View Post
How to add a app drawer in the launcher, i mean how to add five icons in the app drawer ?

app drawer or dock?
or a button to draw or show all your apps[app drawer]?

check My Launchers and please provide feedback...links are mentioned below in my works..

Tags
android launcher, custom launche
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes