Customize Project

Project customizing

Project Structure

After importing project successfully you will get project structure like below image

Within each Android app module, files are shown in the following groups:

manifest

Contains the AndroidManifest.xml file.

java

Contains the Java source code files, separated by package names, including JUnit test code.

res

Contains all non-code resources, such as XML layouts, UI strings, and bitmap images, divided into corresponding sub-directories. For more information about all possible resource types, see Providing Resources.

To know more about project structure please go through this link Android Project Structure

Change App name

To change project name follow below steps.

App > res > values > strings.xml

<string name="app_name">All in One</string>

Change App colors

App > res > values > colors.xml

<color name="colorPrimary">#3F51B5</color><color name="colorPrimaryDark">#303F9F</color><color name="colorAccent">#4cd964</color><color name="colorBlack">#000</color><color name="colorWhite">#fff</color><color name="colorSwitch">#4cd964</color><color name="colortranferant">#c3ecebeb</color><color name="material_blue_500">#009688</color><color name="material_blue_700">#00796B</color><color name="material_green_A200">#FD87A9</color>

Change App icon

Place your app icon inside mipmap folder -> app\src\main\res\mipmap\

Icon of the name should be "ic_launcher.png"

Change App Package Name

Open App level build.gradle and change ApplicationId variable inside android > defaultConfig

applicationId "com.itechnotion.allinone"

Add New Social Website

Boolean fbShow = sharedObjects.preferencesEditor.getBoolean(AppConstants.FACEBOOK);

socialListBeanList.add(new SocialListBean("Facebook", R.drawable.bg_fb, fbShow, R.drawable.ic_fbicon)); ditor.getBoolean(AppConstants.FACEBOOK);

In above line add your social website name image

Go to in layout file in activity_apps.xml

Add below code in this file

               
 <LinearLayout
                    android:id="@+id/lin_insta"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <LinearLayout
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:layout_margin="@dimen/margin10"
                            android:alpha="1"
                            android:background="@drawable/bg_instaround"
                            android:gravity="center"
                            android:orientation="vertical">

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:background="@drawable/ic_instaicon"
                                android:padding="5dp" />
                        </LinearLayout>

                        <ImageView
                            android:id="@+id/arrow_apps"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/margin10"
                            android:visibility="gone" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/tv_insta"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/sfprodisplayregular"
                            android:text="@string/instagram"
                            android:textColor="@color/colorBlack"
                            android:textSize="@dimen/titletext" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:padding="5dp">

                        <Switch
                            android:id="@+id/instaSwitch"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:checked="true" />
                    </LinearLayout>
                </LinearLayout>
  • Go to Setting page open AppsActivity

  • Boolean fbShow = sharedObjects.preferencesEditor.getBoolean(AppConstants.FACEBOOK);

  • mFbSwitch.setChecked(fbShow);

  • mFbSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { // do something when check is selected sharedObjects.preferencesEditor.setBoolean(AppConstants.FACEBOOK, true); } else { //do something when unchecked sharedObjects.preferencesEditor.setBoolean(AppConstants.FACEBOOK, false); } } });

  • case R.id.lin_fb: // TODO 18/04/30 if (mFbSwitch.isChecked()) { mFbSwitch.setChecked(false); } else { mFbSwitch.setChecked(true); } break;

Solved Gradle Error

Follow this link https://www.youtube.com/watch?v=ckbBhs_Ppv4 for solved to gradle AAPT error.

Last updated