GUI like Evernote Menu
In previous post I tried to make a GUI like Google Keep.
In this post I tried to clone Evernote Menu layout.
As always,do not take this code too seriously, it is just an example.
We start with ActionBar.
With Android Action Bar Style Generator (by Jeff Gilfelt) we choose a background and generate our zip code. We take only the part that interests us and integrate it.
Then we start with first component. We put a ScrollWiew.
The first box will contain Account info. We use a LinearLayout with a ImageView and a TextView.
We can do it in many ways, with a GridView for example. I choose to use this layout:
With left, right and bottom margin, we realize a divider between 4 images.
For the button background we use:
Now we add list.
We can't use a ListView, because we are inside a ScrollView.
Just use a LinearLayout instead, with an Adapter.
I choose a LinearLayout.
...and we obtain final GUI.
You can get code from GitHub:
We start with ActionBar.
With Android Action Bar Style Generator (by Jeff Gilfelt) we choose a background and generate our zip code. We take only the part that interests us and integrate it.
For our Activity we choose a RelativeLayout, and we put it under ActionBar.
Then we start with first component. We put a ScrollWiew.
Inside the scrollView we put a LinearLayout that will contain all components...............
The first box will contain Account info. We use a LinearLayout with a ImageView and a TextView.
Then we put a divider, a box with 2x2 buttons and another divider.....
We can do it in many ways, with a GridView for example. I choose to use this layout:
It is very important android:layout_weight="1". In this way each image take up half width of its parent........ .....
With left, right and bottom margin, we realize a divider between 4 images.
For the button background we use:
We also should use a selector, something like this:
Now we add list.
We can't use a ListView, because we are inside a ScrollView.
Just use a LinearLayout instead, with an Adapter.
In our Activity we use a very simple Adapter:public class EvernoteListLayout extends LinearLayout implements View.OnClickListener { private Adapter list; private View.OnClickListener mListener; public EvernoteListLayout(Context context) { super(context); } public EvernoteListLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public EvernoteListLayout(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void onClick(View v) { if (mListener!=null) mListener.onClick(v); } public void setList(Adapter list) { this.list = list; //Popolute list if (this.list!=null){ for (int i=0;i
private class MyListAdapter extends BaseAdapter { String[] items = new String[] { "Title1", "Title2", "Title3", "Title4", "Title5" , "Title 6" , "Title 7" }; @Override public int getCount() { return items.length; } @Override public Object getItem(int position) { return items[position]; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(getApplicationContext()). inflate(R.layout.evernote_list_item, parent, false); } // setup our row TextView text = (TextView) convertView.findViewById(R.id.ev_list_text); text.setText(items[position]); ImageView image = (ImageView) convertView.findViewById(R.id.ev_list_image); image.setImageResource(R.drawable.ic_labels); TextView textnumber = (TextView) convertView. findViewById(R.id.ev_list_textnumber); textnumber.setText(""+position); return convertView; } }For each row we have this layout, defined in evernote_list_item.xml
Last component is the footer bar.
I choose a LinearLayout.
. It is important android:layout_alignParentBottom="true" to align this layout to bottom.
...and we obtain final GUI.
You can get code from GitHub:
terpgecred-shi Jared Ellenberg https://wakelet.com/wake/7xxzY1UUYpN37d_AvjQoh
ReplyDeletecoabestlugoo
raeprobli_wo Katie Perry https://www.orhansalliel.com/profile/Community-Organizing-And-Development-4th-Editionepub/profile
ReplyDeletepuclutome
guiverZquiga Darrell Orlando Disk Drill
ReplyDeletehttps://filesbag.net/category/multimedia/video-editors/
Avast Cleanup
chihojehot