Skip to content

Commit

Permalink
meninblack
Browse files Browse the repository at this point in the history
  • Loading branch information
p32929 committed Oct 15, 2019
1 parent f23623d commit 0d05b3f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add the dependency

```
dependencies {
implementation 'com.github.p32929:HouseAds2:1.0.0.9'
implementation 'com.github.p32929:HouseAds2:1.0.0.10'
}
```

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/p32929/myhouseads2/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
);
houseAds.setFeedbackEmail("[email protected]");
houseAds.autoChangeBannerAds(60);
houseAds.setMenInBlack(true);
houseAds.shuffleBeforeShowingDialog();
}

Expand Down
27 changes: 24 additions & 3 deletions myhouseads2lib/src/main/java/p32929/myhouseads2lib/HouseAds.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class HouseAds {
private int bannerCount = 0;
private MyAdView currentAdView;
boolean shuffleDialogAds = false;
boolean menInBlack = false;

public HouseAds(final Context context, String url) {
this.context = context;
Expand Down Expand Up @@ -151,7 +152,7 @@ public void showInterAds() {

String title = adArrayList.size() == 0 ? "THANK YOU" : "RECOMMENDED APPS";

new AlertDialog
final AlertDialog dialog = new AlertDialog
.Builder(context)
.setTitle(title)
.setView(view)
Expand All @@ -172,8 +173,20 @@ public void onClick(DialogInterface dialogInterface, int i) {
public void onClick(DialogInterface dialogInterface, int i) {
((Activity) context).finish();
}
})
.show();
}).create();

if (menInBlack) {
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialogInterface) {
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(context.getResources().getColor(R.color.primaryText));
dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(context.getResources().getColor(R.color.primaryText));
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(context.getResources().getColor(R.color.primaryText));
}
});
}

dialog.show();
}

private void shareApp() {
Expand All @@ -198,6 +211,10 @@ public void showRateDialog() {
.setView(dialogView)
.show();

if (menInBlack) {
button.setTextColor(context.getResources().getColor(R.color.primaryText));
}

button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down Expand Up @@ -248,4 +265,8 @@ private void rateApp() {
public void shuffleBeforeShowingDialog() {
shuffleDialogAds = true;
}

public void setMenInBlack(boolean menInBlack) {
this.menInBlack = menInBlack;
}
}

0 comments on commit 0d05b3f

Please sign in to comment.