Skip to content

Commit

Permalink
better cover quality
Browse files Browse the repository at this point in the history
  • Loading branch information
TCL committed Jul 14, 2022
1 parent 1ccc12e commit d697f1a
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
50 changes: 49 additions & 1 deletion app/src/main/java/com/aboutpage/aboutpage/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/about_icon_copy_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#000000"
android:pathData="M10.08,10.86c0.05,-0.33 0.16,-0.62 0.3,-0.87s0.34,-0.46 0.59,-0.62c0.24,-0.15 0.54,-0.22 0.91,-0.23 0.23,0.01 0.44,0.05 0.63,0.13 0.2,0.09 0.38,0.21 0.52,0.36s0.25,0.33 0.34,0.53 0.13,0.42 0.14,0.64h1.79c-0.02,-0.47 -0.11,-0.9 -0.28,-1.29s-0.4,-0.73 -0.7,-1.01 -0.66,-0.5 -1.08,-0.66 -0.88,-0.23 -1.39,-0.23c-0.65,0 -1.22,0.11 -1.7,0.34s-0.88,0.53 -1.2,0.92 -0.56,0.84 -0.71,1.36S8,11.29 8,11.87v0.27c0,0.58 0.08,1.12 0.23,1.64s0.39,0.97 0.71,1.35 0.72,0.69 1.2,0.91 1.05,0.34 1.7,0.34c0.47,0 0.91,-0.08 1.32,-0.23s0.77,-0.36 1.08,-0.63 0.56,-0.58 0.74,-0.94 0.29,-0.74 0.3,-1.15h-1.79c-0.01,0.21 -0.06,0.4 -0.15,0.58s-0.21,0.33 -0.36,0.46 -0.32,0.23 -0.52,0.3c-0.19,0.07 -0.39,0.09 -0.6,0.1 -0.36,-0.01 -0.66,-0.08 -0.89,-0.23 -0.25,-0.16 -0.45,-0.37 -0.59,-0.62s-0.25,-0.55 -0.3,-0.88 -0.08,-0.67 -0.08,-1v-0.27c0,-0.35 0.03,-0.68 0.08,-1.01zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
</vector>
21 changes: 21 additions & 0 deletions app/src/main/res/drawable/filee.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20,21V19C20,17.9391 19.5786,16.9217 18.8284,16.1716C18.0783,15.4214 17.0609,15 16,15H8C6.9391,15 5.9217,15.4214 5.1716,16.1716C4.4214,16.9217 4,17.9391 4,19V21"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#9FA1A3"
android:strokeLineCap="round"/>
<path
android:pathData="M12,11C14.2091,11 16,9.2091 16,7C16,4.7909 14.2091,3 12,3C9.7909,3 8,4.7909 8,7C8,9.2091 9.7909,11 12,11Z"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#9FA1A3"
android:strokeLineCap="round"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">Aboutpage</string>
<string name="copy_right" translatable="false">Copyrights © %1$d</string>
</resources>

0 comments on commit d697f1a

Please sign in to comment.