diff --git a/.idea/misc.xml b/.idea/misc.xml index 27148c2..df57f55 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -6,6 +6,9 @@ + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index dde1a80..63fcc47 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,6 +33,7 @@ dependencies { implementation 'com.google.android.material:material:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' testImplementation 'junit:junit:4.13.2' + implementation project(':aboutuslibrary') androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } \ No newline at end of file diff --git a/app/src/main/java/com/aboutpage/aboutpage/MainActivity.java b/app/src/main/java/com/aboutpage/aboutpage/MainActivity.java index 3516404..ad938e7 100644 --- a/app/src/main/java/com/aboutpage/aboutpage/MainActivity.java +++ b/app/src/main/java/com/aboutpage/aboutpage/MainActivity.java @@ -3,12 +3,60 @@ import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.widget.Toast; + +import com.aboutpage.aboutuslibrary.AboutPage; +import com.aboutpage.aboutuslibrary.Element; + +import java.util.Calendar; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); + + Element adsElement = new Element(); + adsElement.setTitle("Advertise with us"); + + View aboutPage = new AboutPage(this) + .isRTL(false) + .setImage(R.drawable.filee) + .addItem(new Element().setTitle("Version 1.0.0")) + .addItem(adsElement) + .addGroup("Connect with us") + .addEmail("samwelnyandoro1@gmail.com") + .addWebsite("https://samwelnyandoro1.netlify.app/") + .addFacebook("sammy.stennet.52") + .addTwitter("samwelnyandoro1") + .addYoutube("UCdPQtdWIsg7_pi4mrRu46vA") + .addPlayStore("com.allhub.allhub") + .addInstagram("samwelnyandoro1") + .addGitHub("samwelnyandoro") + .addItem(getCopyRightsElement()) + .create(); + + setContentView(aboutPage); + } + + + Element getCopyRightsElement() { + Element copyRightsElement = new Element(); + final String copyrights = String.format(getString(R.string.copy_right), Calendar.getInstance().get(Calendar.YEAR)); + copyRightsElement.setTitle(copyrights); + copyRightsElement.setIconDrawable(R.drawable.about_icon_copy_right); + copyRightsElement.setAutoApplyIconTint(true); + copyRightsElement.setIconTint(com.aboutpage.aboutuslibrary.R.color.about_item_icon_color); + copyRightsElement.setIconNightTint(android.R.color.white); + copyRightsElement.setGravity(Gravity.CENTER); + copyRightsElement.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(MainActivity.this, copyrights, Toast.LENGTH_SHORT).show(); + } + }); + return copyRightsElement; } } \ No newline at end of file diff --git a/app/src/main/res/drawable/about_icon_copy_right.xml b/app/src/main/res/drawable/about_icon_copy_right.xml new file mode 100644 index 0000000..91fcd4b --- /dev/null +++ b/app/src/main/res/drawable/about_icon_copy_right.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/filee.xml b/app/src/main/res/drawable/filee.xml new file mode 100644 index 0000000..b2da2b2 --- /dev/null +++ b/app/src/main/res/drawable/filee.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d7485f2..3d0aec3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ Aboutpage + Copyrights © %1$d \ No newline at end of file