Android How to make Align bottom

Just add android:layout_alignParentBottom="true" into your layout code

Example :

Advertisements

Android different screen size image for hdpi , mdpi , ldpi

320dp: a typical phone screen (240×320 ldpi, 320×480 mdpi, 480×800 hdpi, etc).
480dp: a tweener tablet like the Streak (480×800 mdpi).
600dp: a 7” tablet (600×1024 mdpi).
720dp: a 10” tablet (720×1280 mdpi, 800×1280 mdpi, etc).

details : http://stackoverflow.com/questions/6166677/android-screen-size-hdpi-ldpi-mdpi

Android Recycler view Horizontal and vertical Orientation Scroll Controll

mLayoutManager = new LinearLayoutManager(convertView.getContext(),LinearLayoutManager.HORIZONTAL,false);

Complete Example :


import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dsb.deshipos.Adapter.CatergoryAdapter;
import com.dsb.deshipos.Library.HandlingServer;
import com.dsb.deshipos.Model.Category;
import com.dsb.deshipos.R;

import java.util.ArrayList;

/**
* Created by dynamicsolversbangladesh1 on 3/31/16.
*/
public class ItemListFragment extends Fragment {
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;

ArrayList categoryArrayList;

HandlingServer handlingServer;

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View convertView = inflater.inflate(R.layout.itemslistfragmentlayout, container, false);

mRecyclerView = (RecyclerView) convertView.findViewById(R.id.item_recycler);

// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView.setHasFixedSize(true);

// use a linear layout manager
mLayoutManager = new LinearLayoutManager(convertView.getContext(),LinearLayoutManager.HORIZONTAL,false);
mRecyclerView.setLayoutManager(mLayoutManager);

handlingServer=new HandlingServer(convertView.getContext());
categoryArrayList=handlingServer.getAllCategories();

// specify an adapter (see also next example)
mAdapter = new CatergoryAdapter(convertView.getContext(),categoryArrayList);
mRecyclerView.setAdapter(mAdapter);
return convertView;
}
}