Browsed by
Day: March 4, 2018

Android create border radius for Button , Views , EditText and others

Android create border radius for Button , Views , EditText and others

Step – 1: Create xml layout in drawable folder <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:state_pressed=”true” > <shape android:shape=”rectangle” > <corners android:radius=”3dip” /> <stroke android:width=”1dip” android:color=”#5e7974″ /> <gradient android:angle=”-90″ android:startColor=”#345953″ android:endColor=”#689a92″ /> </shape> </item> <item android:state_focused=”true”> <shape android:shape=”rectangle” > <corners android:radius=”3dip” /> <stroke android:width=”1dip” android:color=”#5e7974″ /> <solid android:color=”#58857e”/> </shape> </item> <item > <shape android:shape=”rectangle” > <corners android:radius=”3dip” /> <stroke android:width=”1dip” android:color=”#5e7974″ /> <gradient android:angle=”-90″ android:startColor=”#8dbab3″ android:endColor=”#58857e” /> </shape> </item> </selector> Step 2 : Implement on anywhere like button and…

Read More Read More

Android Fragment basic code structure

Android Fragment basic code structure

public class BasicFragment extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.basic_fragment_layout, container, false); return view; } }