Commit e32d8fa94456119a1e808dbb3065d6b2275bc30d
1 parent
37a8ffe7
更新demo样式
Showing
11 changed files
with
112 additions
and
49 deletions
app/src/main/java/cn/vlion/simple/BannerActivity.java
| @@ -12,6 +12,8 @@ import cn.vlion.ad.moudle.banner.BannerView; | @@ -12,6 +12,8 @@ import cn.vlion.ad.moudle.banner.BannerView; | ||
| 12 | import cn.vlion.ad.moudle.banner.BannerViewListener; | 12 | import cn.vlion.ad.moudle.banner.BannerViewListener; |
| 13 | import cn.vlion.simple.util.ScreenUtil; | 13 | import cn.vlion.simple.util.ScreenUtil; |
| 14 | 14 | ||
| 15 | +import static cn.vlion.simple.MainActivity.TAG_ID; | ||
| 16 | + | ||
| 15 | public class BannerActivity extends AppCompatActivity { | 17 | public class BannerActivity extends AppCompatActivity { |
| 16 | 18 | ||
| 17 | private static final String TAG = "BannerActivity"; | 19 | private static final String TAG = "BannerActivity"; |
| @@ -24,11 +26,12 @@ public class BannerActivity extends AppCompatActivity { | @@ -24,11 +26,12 @@ public class BannerActivity extends AppCompatActivity { | ||
| 24 | super.onCreate(savedInstanceState); | 26 | super.onCreate(savedInstanceState); |
| 25 | setContentView(R.layout.activity_banner); | 27 | setContentView(R.layout.activity_banner); |
| 26 | bannerContainer = (RelativeLayout) findViewById(R.id.bannerContainer); | 28 | bannerContainer = (RelativeLayout) findViewById(R.id.bannerContainer); |
| 29 | + String tagId = getIntent().getStringExtra(TAG_ID); | ||
| 27 | 30 | ||
| 28 | BannerManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 31 | BannerManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 29 | //430 h5 | 32 | //430 h5 |
| 30 | //431 image | 33 | //431 image |
| 31 | - bannerView = BannerManager.getInstance().getBannerView(this, "430", new BannerViewListener() { | 34 | + bannerView = BannerManager.getInstance().getBannerView(this, tagId, new BannerViewListener() { |
| 32 | @Override | 35 | @Override |
| 33 | public void onRequestSuccess(int viewWidth, int viewHeight) { | 36 | public void onRequestSuccess(int viewWidth, int viewHeight) { |
| 34 | Log.e(TAG, "onRequestSuccess: " + viewWidth + "," + viewHeight); | 37 | Log.e(TAG, "onRequestSuccess: " + viewWidth + "," + viewHeight); |
app/src/main/java/cn/vlion/simple/MainActivity.java
| @@ -8,30 +8,31 @@ import android.view.View; | @@ -8,30 +8,31 @@ import android.view.View; | ||
| 8 | public class MainActivity extends AppCompatActivity { | 8 | public class MainActivity extends AppCompatActivity { |
| 9 | 9 | ||
| 10 | private static final String TAG = "MainActivity"; | 10 | private static final String TAG = "MainActivity"; |
| 11 | + public static final String TAG_ID = "tagId"; | ||
| 11 | 12 | ||
| 12 | @Override | 13 | @Override |
| 13 | protected void onCreate(Bundle savedInstanceState) { | 14 | protected void onCreate(Bundle savedInstanceState) { |
| 14 | super.onCreate(savedInstanceState); | 15 | super.onCreate(savedInstanceState); |
| 15 | setContentView(R.layout.activity_main); | 16 | setContentView(R.layout.activity_main); |
| 16 | - findViewById(R.id.bannerBtn).setOnClickListener(new View.OnClickListener() { | ||
| 17 | - @Override | ||
| 18 | - public void onClick(View view) { | ||
| 19 | - startActivity(new Intent(MainActivity.this, BannerActivity.class)); | ||
| 20 | - } | ||
| 21 | - }); | ||
| 22 | - | ||
| 23 | - findViewById(R.id.spotBtn).setOnClickListener(new View.OnClickListener() { | ||
| 24 | - @Override | ||
| 25 | - public void onClick(View view) { | ||
| 26 | - startActivity(new Intent(MainActivity.this, SpotActivity.class)); | ||
| 27 | - } | ||
| 28 | - }); | ||
| 29 | - | ||
| 30 | - findViewById(R.id.nativeBtn).setOnClickListener(new View.OnClickListener() { | ||
| 31 | - @Override | ||
| 32 | - public void onClick(View v) { | ||
| 33 | - startActivity(new Intent(MainActivity.this, NativeActivity.class)); | ||
| 34 | - } | ||
| 35 | - }); | 17 | + } |
| 18 | + | ||
| 19 | + public void bannerWebClick(View view) { | ||
| 20 | + startActivity(new Intent(MainActivity.this, BannerActivity.class).putExtra(TAG_ID, "430")); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public void bannerImgClick(View view) { | ||
| 24 | + startActivity(new Intent(MainActivity.this, BannerActivity.class).putExtra(TAG_ID, "431")); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void spotWebClick(View view) { | ||
| 28 | + startActivity(new Intent(MainActivity.this, SpotActivity.class).putExtra(TAG_ID, "434")); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public void spotImgClick(View view) { | ||
| 32 | + startActivity(new Intent(MainActivity.this, SpotActivity.class).putExtra(TAG_ID, "438")); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void nativeClick(View view) { | ||
| 36 | + startActivity(new Intent(MainActivity.this, NativeActivity.class)); | ||
| 36 | } | 37 | } |
| 37 | } | 38 | } |
app/src/main/java/cn/vlion/simple/NativeActivity.java
| @@ -5,6 +5,7 @@ import android.support.annotation.Nullable; | @@ -5,6 +5,7 @@ import android.support.annotation.Nullable; | ||
| 5 | import android.support.v7.app.AppCompatActivity; | 5 | import android.support.v7.app.AppCompatActivity; |
| 6 | import android.util.Log; | 6 | import android.util.Log; |
| 7 | import android.view.View; | 7 | import android.view.View; |
| 8 | +import android.widget.Toast; | ||
| 8 | 9 | ||
| 9 | import com.google.gson.Gson; | 10 | import com.google.gson.Gson; |
| 10 | 11 | ||
| @@ -24,7 +25,7 @@ public class NativeActivity extends AppCompatActivity { | @@ -24,7 +25,7 @@ public class NativeActivity extends AppCompatActivity { | ||
| 24 | 25 | ||
| 25 | private static final String adId_AppWall = ""; | 26 | private static final String adId_AppWall = ""; |
| 26 | private static final String adId_Carousel = "359"; | 27 | private static final String adId_Carousel = "359"; |
| 27 | - private static final String adId_Feeds = "357"; | 28 | + private static final String adId_Feeds = "440"; |
| 28 | private static final String adId_News = ""; | 29 | private static final String adId_News = ""; |
| 29 | private static final String adId_Waterfall = "358"; | 30 | private static final String adId_Waterfall = "358"; |
| 30 | 31 | ||
| @@ -39,11 +40,13 @@ public class NativeActivity extends AppCompatActivity { | @@ -39,11 +40,13 @@ public class NativeActivity extends AppCompatActivity { | ||
| 39 | @Override | 40 | @Override |
| 40 | public void onRequestSuccess(NativeAppWallData data) { | 41 | public void onRequestSuccess(NativeAppWallData data) { |
| 41 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); | 42 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); |
| 43 | + Toast.makeText(NativeActivity.this, "数据获取成功 " + new Gson().toJson(data), Toast.LENGTH_SHORT).show(); | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | @Override | 46 | @Override |
| 45 | public void onRequestFailed(int code, String message) { | 47 | public void onRequestFailed(int code, String message) { |
| 46 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); | 48 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); |
| 49 | + Toast.makeText(NativeActivity.this, "数据加载失败 : code = " + code + " , message = " + message, Toast.LENGTH_SHORT).show(); | ||
| 47 | } | 50 | } |
| 48 | }); | 51 | }); |
| 49 | } | 52 | } |
| @@ -53,11 +56,13 @@ public class NativeActivity extends AppCompatActivity { | @@ -53,11 +56,13 @@ public class NativeActivity extends AppCompatActivity { | ||
| 53 | @Override | 56 | @Override |
| 54 | public void onRequestSuccess(NativeCarouselData data) { | 57 | public void onRequestSuccess(NativeCarouselData data) { |
| 55 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); | 58 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); |
| 59 | + Toast.makeText(NativeActivity.this, "数据获取成功 " + new Gson().toJson(data), Toast.LENGTH_SHORT).show(); | ||
| 56 | } | 60 | } |
| 57 | 61 | ||
| 58 | @Override | 62 | @Override |
| 59 | public void onRequestFailed(int code, String message) { | 63 | public void onRequestFailed(int code, String message) { |
| 60 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); | 64 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); |
| 65 | + Toast.makeText(NativeActivity.this, "数据加载失败 : code = " + code + " , message = " + message, Toast.LENGTH_SHORT).show(); | ||
| 61 | } | 66 | } |
| 62 | }); | 67 | }); |
| 63 | } | 68 | } |
| @@ -67,11 +72,13 @@ public class NativeActivity extends AppCompatActivity { | @@ -67,11 +72,13 @@ public class NativeActivity extends AppCompatActivity { | ||
| 67 | @Override | 72 | @Override |
| 68 | public void onRequestSuccess(NativeFeedsData data) { | 73 | public void onRequestSuccess(NativeFeedsData data) { |
| 69 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); | 74 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); |
| 75 | + Toast.makeText(NativeActivity.this, "数据获取成功 " + new Gson().toJson(data), Toast.LENGTH_SHORT).show(); | ||
| 70 | } | 76 | } |
| 71 | 77 | ||
| 72 | @Override | 78 | @Override |
| 73 | public void onRequestFailed(int code, String message) { | 79 | public void onRequestFailed(int code, String message) { |
| 74 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); | 80 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); |
| 81 | + Toast.makeText(NativeActivity.this, "数据加载失败 : code = " + code + " , message = " + message, Toast.LENGTH_SHORT).show(); | ||
| 75 | } | 82 | } |
| 76 | }); | 83 | }); |
| 77 | } | 84 | } |
| @@ -81,11 +88,13 @@ public class NativeActivity extends AppCompatActivity { | @@ -81,11 +88,13 @@ public class NativeActivity extends AppCompatActivity { | ||
| 81 | @Override | 88 | @Override |
| 82 | public void onRequestSuccess(NativeNewsData data) { | 89 | public void onRequestSuccess(NativeNewsData data) { |
| 83 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); | 90 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); |
| 91 | + Toast.makeText(NativeActivity.this, "数据获取成功 " + new Gson().toJson(data), Toast.LENGTH_SHORT).show(); | ||
| 84 | } | 92 | } |
| 85 | 93 | ||
| 86 | @Override | 94 | @Override |
| 87 | public void onRequestFailed(int code, String message) { | 95 | public void onRequestFailed(int code, String message) { |
| 88 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); | 96 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); |
| 97 | + Toast.makeText(NativeActivity.this, "数据加载失败 : code = " + code + " , message = " + message, Toast.LENGTH_SHORT).show(); | ||
| 89 | } | 98 | } |
| 90 | }); | 99 | }); |
| 91 | } | 100 | } |
| @@ -95,11 +104,13 @@ public class NativeActivity extends AppCompatActivity { | @@ -95,11 +104,13 @@ public class NativeActivity extends AppCompatActivity { | ||
| 95 | @Override | 104 | @Override |
| 96 | public void onRequestSuccess(NativeWaterfallData data) { | 105 | public void onRequestSuccess(NativeWaterfallData data) { |
| 97 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); | 106 | Log.e("DemoView", "数据获取成功 " + new Gson().toJson(data)); |
| 107 | + Toast.makeText(NativeActivity.this, "数据获取成功 " + new Gson().toJson(data), Toast.LENGTH_SHORT).show(); | ||
| 98 | } | 108 | } |
| 99 | 109 | ||
| 100 | @Override | 110 | @Override |
| 101 | public void onRequestFailed(int code, String message) { | 111 | public void onRequestFailed(int code, String message) { |
| 102 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); | 112 | Log.e("DemoView", "数据加载失败 : code = " + code + " , message = " + message); |
| 113 | + Toast.makeText(NativeActivity.this, "数据加载失败 : code = " + code + " , message = " + message, Toast.LENGTH_SHORT).show(); | ||
| 103 | } | 114 | } |
| 104 | }); | 115 | }); |
| 105 | } | 116 | } |
app/src/main/java/cn/vlion/simple/SplashActivity.java
| @@ -74,7 +74,7 @@ public class SplashActivity extends AppCompatActivity { | @@ -74,7 +74,7 @@ public class SplashActivity extends AppCompatActivity { | ||
| 74 | SplashManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 74 | SplashManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 75 | //432 h5 | 75 | //432 h5 |
| 76 | //433 image | 76 | //433 image |
| 77 | - SplashManager.getInstance().showSplash(this, "432", new SplashViewListener() { | 77 | + SplashManager.getInstance().showSplash(this, "433", new SplashViewListener() { |
| 78 | 78 | ||
| 79 | @Override | 79 | @Override |
| 80 | public void onRequestSuccess(int viewWidth, int viewHeight) { | 80 | public void onRequestSuccess(int viewWidth, int viewHeight) { |
app/src/main/java/cn/vlion/simple/SpotActivity.java
| @@ -7,6 +7,7 @@ import android.util.Log; | @@ -7,6 +7,7 @@ import android.util.Log; | ||
| 7 | import android.view.View; | 7 | import android.view.View; |
| 8 | import android.view.ViewGroup; | 8 | import android.view.ViewGroup; |
| 9 | import android.widget.RelativeLayout; | 9 | import android.widget.RelativeLayout; |
| 10 | +import android.widget.Toast; | ||
| 10 | 11 | ||
| 11 | import cn.vlion.ad.core.Config; | 12 | import cn.vlion.ad.core.Config; |
| 12 | import cn.vlion.ad.moudle.spot.SpotManager; | 13 | import cn.vlion.ad.moudle.spot.SpotManager; |
| @@ -14,6 +15,8 @@ import cn.vlion.ad.moudle.spot.SpotViewListener; | @@ -14,6 +15,8 @@ import cn.vlion.ad.moudle.spot.SpotViewListener; | ||
| 14 | 15 | ||
| 15 | import cn.vlion.simple.util.ScreenUtil; | 16 | import cn.vlion.simple.util.ScreenUtil; |
| 16 | 17 | ||
| 18 | +import static cn.vlion.simple.MainActivity.TAG_ID; | ||
| 19 | + | ||
| 17 | /** | 20 | /** |
| 18 | * Created by gujun on 2017/10/12. | 21 | * Created by gujun on 2017/10/12. |
| 19 | */ | 22 | */ |
| @@ -23,11 +26,13 @@ public class SpotActivity extends AppCompatActivity { | @@ -23,11 +26,13 @@ public class SpotActivity extends AppCompatActivity { | ||
| 23 | private static final String TAG = "SpotActivity"; | 26 | private static final String TAG = "SpotActivity"; |
| 24 | private RelativeLayout spotAdContainer; | 27 | private RelativeLayout spotAdContainer; |
| 25 | private RelativeLayout adLayout; | 28 | private RelativeLayout adLayout; |
| 29 | + private String tagId; | ||
| 26 | 30 | ||
| 27 | @Override | 31 | @Override |
| 28 | protected void onCreate(@Nullable Bundle savedInstanceState) { | 32 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 29 | super.onCreate(savedInstanceState); | 33 | super.onCreate(savedInstanceState); |
| 30 | setContentView(R.layout.activity_spot); | 34 | setContentView(R.layout.activity_spot); |
| 35 | + tagId = getIntent().getStringExtra(TAG_ID); | ||
| 31 | addSpotAd(); | 36 | addSpotAd(); |
| 32 | } | 37 | } |
| 33 | 38 | ||
| @@ -39,7 +44,7 @@ public class SpotActivity extends AppCompatActivity { | @@ -39,7 +44,7 @@ public class SpotActivity extends AppCompatActivity { | ||
| 39 | SpotManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 44 | SpotManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 40 | //434 h5 | 45 | //434 h5 |
| 41 | //438 image | 46 | //438 image |
| 42 | - SpotManager.getInstance().showSpot(this, "438", new SpotViewListener() { | 47 | + SpotManager.getInstance().showSpot(this, tagId, new SpotViewListener() { |
| 43 | 48 | ||
| 44 | @Override | 49 | @Override |
| 45 | public void onRequestSuccess(int viewWidth, int viewHeight, int closeViewHeight) { | 50 | public void onRequestSuccess(int viewWidth, int viewHeight, int closeViewHeight) { |
| @@ -51,6 +56,7 @@ public class SpotActivity extends AppCompatActivity { | @@ -51,6 +56,7 @@ public class SpotActivity extends AppCompatActivity { | ||
| 51 | @Override | 56 | @Override |
| 52 | public void onRequestFailed(int code, String errorMsg) { | 57 | public void onRequestFailed(int code, String errorMsg) { |
| 53 | Log.e(TAG, "onRequestFailed: " + code + "," + errorMsg); | 58 | Log.e(TAG, "onRequestFailed: " + code + "," + errorMsg); |
| 59 | + Toast.makeText(SpotActivity.this, "onRequestFailed: " + code + "," + errorMsg, Toast.LENGTH_SHORT).show(); | ||
| 54 | } | 60 | } |
| 55 | 61 | ||
| 56 | @Override | 62 | @Override |
app/src/main/res/drawable/back.png
app/src/main/res/drawable/btn_bg.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle" | ||
| 4 | + android:useLevel="false"> | ||
| 5 | + | ||
| 6 | + <solid android:color="@color/colorAccent" /> | ||
| 7 | + | ||
| 8 | + <corners | ||
| 9 | + android:bottomLeftRadius="20dp" | ||
| 10 | + android:bottomRightRadius="20dp" | ||
| 11 | + android:topLeftRadius="20dp" | ||
| 12 | + android:topRightRadius="20dp" /> | ||
| 13 | + | ||
| 14 | +</shape> | ||
| 0 | \ No newline at end of file | 15 | \ No newline at end of file |
app/src/main/res/layout/activity_main.xml
| @@ -7,26 +7,42 @@ | @@ -7,26 +7,42 @@ | ||
| 7 | tools:context="cn.vlion.simple.MainActivity"> | 7 | tools:context="cn.vlion.simple.MainActivity"> |
| 8 | 8 | ||
| 9 | <Button | 9 | <Button |
| 10 | - android:id="@+id/bannerBtn" | 10 | + android:id="@+id/bannerWebBtn" |
| 11 | + style="@style/buttonTheme" | ||
| 11 | android:layout_width="200dp" | 12 | android:layout_width="200dp" |
| 12 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
| 13 | - android:layout_alignParentBottom="true" | ||
| 14 | - android:layout_centerHorizontal="true" | ||
| 15 | - android:text="横幅广告" /> | 14 | + android:onClick="bannerWebClick" |
| 15 | + android:text="横幅广告(web)" /> | ||
| 16 | 16 | ||
| 17 | <Button | 17 | <Button |
| 18 | - android:id="@+id/spotBtn" | 18 | + android:id="@+id/bannerImgBtn" |
| 19 | + style="@style/buttonTheme" | ||
| 19 | android:layout_width="200dp" | 20 | android:layout_width="200dp" |
| 20 | android:layout_height="wrap_content" | 21 | android:layout_height="wrap_content" |
| 21 | - android:layout_alignParentBottom="true" | ||
| 22 | - android:layout_centerHorizontal="true" | ||
| 23 | - android:text="插屏广告广告" /> | 22 | + android:onClick="bannerImgClick" |
| 23 | + android:text="横幅广告(img)" /> | ||
| 24 | + | ||
| 25 | + <Button | ||
| 26 | + android:id="@+id/spotWebBtn" | ||
| 27 | + style="@style/buttonTheme" | ||
| 28 | + android:layout_width="200dp" | ||
| 29 | + android:layout_height="wrap_content" | ||
| 30 | + android:onClick="spotWebClick" | ||
| 31 | + android:text="插屏广告(web)" /> | ||
| 32 | + | ||
| 33 | + <Button | ||
| 34 | + android:id="@+id/spotImgBtn" | ||
| 35 | + style="@style/buttonTheme" | ||
| 36 | + android:layout_width="200dp" | ||
| 37 | + android:layout_height="wrap_content" | ||
| 38 | + android:onClick="spotImgClick" | ||
| 39 | + android:text="插屏广告(img)" /> | ||
| 24 | 40 | ||
| 25 | <Button | 41 | <Button |
| 26 | android:id="@+id/nativeBtn" | 42 | android:id="@+id/nativeBtn" |
| 43 | + style="@style/buttonTheme" | ||
| 27 | android:layout_width="200dp" | 44 | android:layout_width="200dp" |
| 28 | android:layout_height="wrap_content" | 45 | android:layout_height="wrap_content" |
| 29 | - android:layout_alignParentBottom="true" | ||
| 30 | - android:layout_centerHorizontal="true" | 46 | + android:onClick="nativeClick" |
| 31 | android:text="原生广告" /> | 47 | android:text="原生广告" /> |
| 32 | </LinearLayout> | 48 | </LinearLayout> |
app/src/main/res/layout/activity_native.xml
| @@ -3,46 +3,51 @@ | @@ -3,46 +3,51 @@ | ||
| 3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
| 4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
| 5 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
| 6 | + android:gravity="center" | ||
| 6 | android:orientation="vertical" | 7 | android:orientation="vertical" |
| 7 | - tools:context="cn.vlion.simple.NativeActivity" | ||
| 8 | - android:gravity="center"> | 8 | + tools:context="cn.vlion.simple.NativeActivity"> |
| 9 | 9 | ||
| 10 | <Button | 10 | <Button |
| 11 | android:id="@+id/loadAppWall" | 11 | android:id="@+id/loadAppWall" |
| 12 | + style="@style/buttonTheme" | ||
| 12 | android:layout_width="200dp" | 13 | android:layout_width="200dp" |
| 13 | android:layout_height="wrap_content" | 14 | android:layout_height="wrap_content" |
| 14 | - android:text="@string/loadAppWall" | ||
| 15 | - android:onClick="loadAppWall"/> | 15 | + android:onClick="loadAppWall" |
| 16 | + android:text="@string/loadAppWall" /> | ||
| 16 | 17 | ||
| 17 | <Button | 18 | <Button |
| 18 | android:id="@+id/loadCarousel" | 19 | android:id="@+id/loadCarousel" |
| 20 | + style="@style/buttonTheme" | ||
| 19 | android:layout_width="200dp" | 21 | android:layout_width="200dp" |
| 20 | android:layout_height="wrap_content" | 22 | android:layout_height="wrap_content" |
| 21 | - android:text="@string/loadCarousel" | ||
| 22 | android:layout_marginTop="16dp" | 23 | android:layout_marginTop="16dp" |
| 23 | - android:onClick="loadCarousel"/> | 24 | + android:onClick="loadCarousel" |
| 25 | + android:text="@string/loadCarousel" /> | ||
| 24 | 26 | ||
| 25 | <Button | 27 | <Button |
| 26 | android:id="@+id/loadFeeds" | 28 | android:id="@+id/loadFeeds" |
| 29 | + style="@style/buttonTheme" | ||
| 27 | android:layout_width="200dp" | 30 | android:layout_width="200dp" |
| 28 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
| 29 | - android:text="@string/loadFeeds" | ||
| 30 | android:layout_marginTop="16dp" | 32 | android:layout_marginTop="16dp" |
| 31 | - android:onClick="loadFeeds"/> | 33 | + android:onClick="loadFeeds" |
| 34 | + android:text="@string/loadFeeds" /> | ||
| 32 | 35 | ||
| 33 | <Button | 36 | <Button |
| 34 | android:id="@+id/loadNews" | 37 | android:id="@+id/loadNews" |
| 38 | + style="@style/buttonTheme" | ||
| 35 | android:layout_width="200dp" | 39 | android:layout_width="200dp" |
| 36 | android:layout_height="wrap_content" | 40 | android:layout_height="wrap_content" |
| 37 | - android:text="@string/loadNews" | ||
| 38 | android:layout_marginTop="16dp" | 41 | android:layout_marginTop="16dp" |
| 39 | - android:onClick="loadNews"/> | 42 | + android:onClick="loadNews" |
| 43 | + android:text="@string/loadNews" /> | ||
| 40 | 44 | ||
| 41 | <Button | 45 | <Button |
| 42 | android:id="@+id/loadWaterfall" | 46 | android:id="@+id/loadWaterfall" |
| 47 | + style="@style/buttonTheme" | ||
| 43 | android:layout_width="200dp" | 48 | android:layout_width="200dp" |
| 44 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
| 45 | - android:text="@string/loadWaterfall" | ||
| 46 | android:layout_marginTop="16dp" | 50 | android:layout_marginTop="16dp" |
| 47 | - android:onClick="loadWaterfall"/> | 51 | + android:onClick="loadWaterfall" |
| 52 | + android:text="@string/loadWaterfall" /> | ||
| 48 | </LinearLayout> | 53 | </LinearLayout> |
| 49 | \ No newline at end of file | 54 | \ No newline at end of file |
app/src/main/res/values/colors.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <resources> | 2 | <resources> |
| 3 | - <color name="colorPrimary">#3F51B5</color> | ||
| 4 | - <color name="colorPrimaryDark">#303F9F</color> | ||
| 5 | - <color name="colorAccent">#FF4081</color> | 3 | + <color name="colorPrimary">#4685CA</color> |
| 4 | + <color name="colorPrimaryDark">#25609E</color> | ||
| 5 | + <color name="colorAccent">#5892D0</color> | ||
| 6 | </resources> | 6 | </resources> |
app/src/main/res/values/styles.xml
| @@ -8,4 +8,11 @@ | @@ -8,4 +8,11 @@ | ||
| 8 | <item name="colorAccent">@color/colorAccent</item> | 8 | <item name="colorAccent">@color/colorAccent</item> |
| 9 | </style> | 9 | </style> |
| 10 | 10 | ||
| 11 | + <style name="buttonTheme"> | ||
| 12 | + <item name="android:background">@drawable/btn_bg</item> | ||
| 13 | + <item name="android:textColor">@android:color/white</item> | ||
| 14 | + <item name="android:layout_gravity">center_horizontal</item> | ||
| 15 | + <item name="android:layout_marginTop">20dp</item> | ||
| 16 | + </style> | ||
| 17 | + | ||
| 11 | </resources> | 18 | </resources> |