-
-
Notifications
You must be signed in to change notification settings - Fork 285
/
MainActivity.java
59 lines (51 loc) · 2.2 KB
/
MainActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package mehdi.sakout.aboutpage.sample;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.util.Calendar;
import mehdi.sakout.aboutpage.AboutPage;
import mehdi.sakout.aboutpage.Element;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Element adsElement = new Element();
adsElement.setTitle("Advertise with us");
View aboutPage = new AboutPage(this)
.isRTL(false)
.setImage(R.drawable.dummy_image)
.addItem(new Element().setTitle("Version 6.2"))
.addItem(adsElement)
.addGroup("Connect with us")
.addEmail("elmehdi.sakout@gmail.com")
.addWebsite("https://mehdisakout.com/")
.addFacebook("the.medy")
.addTwitter("medyo80")
.addYoutube("UCdPQtdWIsg7_pi4mrRu46vA")
.addPlayStore("com.ideashower.readitlater.pro")
.addInstagram("medyo80")
.addGitHub("medyo")
.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(mehdi.sakout.aboutpage.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;
}
}