调整广告,修复bug
This commit is contained in:
parent
a06e45c303
commit
8204477341
|
@ -17,8 +17,8 @@ android {
|
||||||
applicationId "com.novelbook.android"
|
applicationId "com.novelbook.android"
|
||||||
minSdkVersion 19 //target 19 Android 4.4 以下版本仅占比4.1%
|
minSdkVersion 19 //target 19 Android 4.4 以下版本仅占比4.1%
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 5
|
versionCode 6
|
||||||
versionName "5.0"
|
versionName "6.0"
|
||||||
|
|
||||||
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
@ -40,13 +40,7 @@ android {
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||||
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
||||||
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
||||||
/* buildConfigField "String","AD_TOUTIAO_APP_ID",'"5019267"'
|
// buildConfigField "String", "CHANNEL",'"DEBUG"'
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_FEEDAD_ID",'"919267464"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_SPLASH_ID",'"819267134"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_BANNER_ID",'"919267016"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_BANNER_NATIVE_ID",'"919267816"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_INTERACTION_ID",'"919267451"'*/
|
|
||||||
// buildConfigField "String", "API_HOST", '""'
|
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "-debug"
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
zipAlignEnabled false
|
zipAlignEnabled false
|
||||||
|
@ -64,7 +58,7 @@ android {
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
|
||||||
/* applicationVariants.all { variant ->
|
/* applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
def outFile = output.outputFile
|
def outFile = output.outputFile
|
||||||
if (outFile != null && outFile.name.endsWith(".apk")) {
|
if (outFile != null && outFile.name.endsWith(".apk")) {
|
||||||
|
@ -79,23 +73,25 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//渠道
|
//渠道
|
||||||
/*productFlavors {
|
/* productFlavors {
|
||||||
// googleplay {}
|
// googleplay {}
|
||||||
ali {
|
ali {
|
||||||
applicationId "com.novelbook.android"
|
applicationId "com.zhushou.wangshu"
|
||||||
versionName "v-qxs-1.0"
|
versionName "v1.0"
|
||||||
buildConfigField "String", "MAIN_HOST", '"http://chqxs.xiaoshuofenxiang.com/api/"'
|
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
||||||
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/qxs.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
||||||
|
|
||||||
|
|
||||||
buildConfigField "String","AD_TOUTIAO_APP_ID",'"5019267"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_FEEDAD_ID",'"919267464"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_SPLASH_ID",'"819267134"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_BANNER_ID",'"919267016"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_BANNER_NATIVE_ID",'"919267816"'
|
|
||||||
buildConfigField "String","AD_SLOT_TOUTIAO_INTERACTION_ID",'"919267451"'
|
|
||||||
}
|
}
|
||||||
|
qq {
|
||||||
|
applicationId "com.zhushou.wangshu"
|
||||||
|
versionName "v1.0"
|
||||||
|
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
||||||
|
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
||||||
|
//buildConfigField "String", "API_HOST", '""'
|
||||||
|
|
||||||
*//* kuan {
|
}
|
||||||
|
*//*kuan {
|
||||||
applicationId "com.novelbook.android"
|
applicationId "com.novelbook.android"
|
||||||
versionName "v-kuan-1.0"
|
versionName "v-kuan-1.0"
|
||||||
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
||||||
|
@ -111,14 +107,7 @@ android {
|
||||||
//buildConfigField "String", "API_HOST", '""'
|
//buildConfigField "String", "API_HOST", '""'
|
||||||
buildConfigField "String", "CHANNEL",'"xiaomi"'
|
buildConfigField "String", "CHANNEL",'"xiaomi"'
|
||||||
}
|
}
|
||||||
qq {
|
|
||||||
applicationId "com.novelbook.android.qq"
|
|
||||||
versionName "v-qq-1.0"
|
|
||||||
buildConfigField "String", "MAIN_HOST", '"http://xiaoshuofenxiang.com/api/"'
|
|
||||||
buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"'
|
|
||||||
//buildConfigField "String", "API_HOST", '""'
|
|
||||||
|
|
||||||
}
|
|
||||||
qxs {
|
qxs {
|
||||||
applicationId "com.novelbook.android.qxs"
|
applicationId "com.novelbook.android.qxs"
|
||||||
versionName "v-qxs-5.0"
|
versionName "v-qxs-5.0"
|
||||||
|
|
|
@ -111,16 +111,28 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if(!Constants.AD_SETTING.isShowAdsense() ||!Constants.AD_SETTING.getSplash().isShow() ){
|
boolean isGoToMain= getIntent().getBooleanExtra(EXTR_LUNCHER,true);
|
||||||
|
if(!Constants.AD_SETTING.isShowAdsense() ||isGoToMain && !Constants.AD_SETTING.getSplash().isShow() ){
|
||||||
goToMainActivity();
|
goToMainActivity();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rid =R.layout.ad_toutiao_activity_splash;
|
int rid =R.layout.ad_toutiao_activity_splash;
|
||||||
if(Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TENCENT_QQ ){
|
int splashSource=Constants.AD_TENCENT_QQ;
|
||||||
rid = R.layout.ad_qq_activity_splash;
|
if(isGoToMain) {
|
||||||
}else if(Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TOUTIAO ){
|
if (Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TENCENT_QQ) {
|
||||||
rid = R.layout.ad_toutiao_activity_splash;
|
rid = R.layout.ad_qq_activity_splash;
|
||||||
|
} else if (Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TOUTIAO) {
|
||||||
|
rid = R.layout.ad_toutiao_activity_splash;
|
||||||
|
splashSource=Constants.AD_TOUTIAO;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (Constants.AD_SETTING.getSplash2().getSource() == Constants.AD_TENCENT_QQ) {
|
||||||
|
rid = R.layout.ad_qq_activity_splash;
|
||||||
|
} else if (Constants.AD_SETTING.getSplash2().getSource() == Constants.AD_TOUTIAO) {
|
||||||
|
// rid = R.layout.ad_toutiao_activity_splash;
|
||||||
|
goToMainActivity();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setContentView(rid);
|
setContentView(rid);
|
||||||
|
@ -142,7 +154,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
|
||||||
);
|
);
|
||||||
tvTitle.setText(R.string.app_name);
|
tvTitle.setText(R.string.app_name);
|
||||||
//加载开屏广告
|
//加载开屏广告
|
||||||
if(Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TOUTIAO ) {
|
if(splashSource == Constants.AD_TOUTIAO ) {
|
||||||
mHandler.sendEmptyMessageDelayed(MSG_GO_MAIN, AD_TIME_OUT);
|
mHandler.sendEmptyMessageDelayed(MSG_GO_MAIN, AD_TIME_OUT);
|
||||||
//step2:创建TTAdNative对象
|
//step2:创建TTAdNative对象
|
||||||
try {
|
try {
|
||||||
|
@ -152,7 +164,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadSplashAd();
|
loadSplashAd();
|
||||||
}else if(Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TENCENT_QQ ){
|
}else if(splashSource == Constants.AD_TENCENT_QQ ){
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
checkAndRequestPermission();
|
checkAndRequestPermission();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SplashAdManager implements Application.ActivityLifecycleCallbacks,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
long in = new Date().getTime() -lastAd;
|
long in = new Date().getTime() -lastAd;
|
||||||
int interVal =60000;//Constants.AD_SETTING.getSplash2().getInterval4Display()*1000;
|
int interVal = Constants.AD_SETTING.getSplash2().getInterval4Display()*1000;
|
||||||
Log.d("zzr", "canShowAd: interval is, " +in + ", canshow? "+ (in >interVal));
|
Log.d("zzr", "canShowAd: interval is, " +in + ", canshow? "+ (in >interVal));
|
||||||
return in >interVal;
|
return in >interVal;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,8 @@ public class SplashAdManager implements Application.ActivityLifecycleCallbacks,
|
||||||
public static void plusPage(Activity activity){
|
public static void plusPage(Activity activity){
|
||||||
pages++;
|
pages++;
|
||||||
if(pages >Constants.AD_SETTING.getSplash2().getPageCount4Display()){
|
if(pages >Constants.AD_SETTING.getSplash2().getPageCount4Display()){
|
||||||
showInterAd(activity);
|
clearPages();
|
||||||
|
showSplashAd(activity);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ static final String TAG = ActivitySetup.class.getSimpleName();
|
||||||
public void run() {
|
public void run() {
|
||||||
super.run();
|
super.run();
|
||||||
mVersion =CommonUtil.getVersion(ActivitySetup.this);
|
mVersion =CommonUtil.getVersion(ActivitySetup.this);
|
||||||
mCacheSize =FileUtils.getCachedSize();
|
mCacheSize =FileUtils.getFormatedCachedSize() ;
|
||||||
handler.sendEmptyMessage(1);
|
handler.sendEmptyMessage(1);
|
||||||
}
|
}
|
||||||
}.start() ;
|
}.start() ;
|
||||||
|
@ -66,12 +66,16 @@ static final String TAG = ActivitySetup.class.getSimpleName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillData() {
|
public void fillData() {
|
||||||
|
|
||||||
tvVersion.setText(mVersion);
|
tvVersion.setText(mVersion);
|
||||||
tvCache.setText(mCacheSize);
|
tvCache.setText(mCacheSize);
|
||||||
|
|
||||||
|
if(mCacheSize.equals("0.00B")){
|
||||||
|
tvCache.setText(R.string.noCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,6 +89,11 @@ static final String TAG = ActivitySetup.class.getSimpleName();
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
break;
|
break;
|
||||||
case R.id.llCache:
|
case R.id.llCache:
|
||||||
|
if(mCacheSize.equals("0.00B")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
final AlertDialog.Builder normalDialog =
|
final AlertDialog.Builder normalDialog =
|
||||||
new AlertDialog.Builder(ActivitySetup.this);
|
new AlertDialog.Builder(ActivitySetup.this);
|
||||||
|
|
||||||
|
@ -98,8 +107,9 @@ static final String TAG = ActivitySetup.class.getSimpleName();
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
FileUtils.clearCache();
|
FileUtils.clearCache();
|
||||||
LitePal.deleteAll(DownloadTask.class);
|
LitePal.deleteAll(DownloadTask.class);
|
||||||
tvCache.setText(FileUtils.getCachedSize());
|
mCacheSize="0.00B";
|
||||||
|
//tvCache.setText(FileUtils.getFormatedCachedSize());
|
||||||
|
tvCache.setText(R.string.noCache);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
normalDialog.setNegativeButton("取消",
|
normalDialog.setNegativeButton("取消",
|
||||||
|
@ -144,6 +154,7 @@ static final String TAG = ActivitySetup.class.getSimpleName();
|
||||||
}else if(Constants.serverVersion==-1){
|
}else if(Constants.serverVersion==-1){
|
||||||
handler.sendEmptyMessage(MSG_VERSION_LATEST);
|
handler.sendEmptyMessage(MSG_VERSION_LATEST);
|
||||||
}
|
}
|
||||||
|
handler.sendEmptyMessage(1000);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
|
||||||
|
|
||||||
private static String TAG ="Activity_base";
|
private static String TAG ="Activity_base";
|
||||||
private ProgressDialog mProgressDialog;
|
private ProgressDialog mProgressDialog;
|
||||||
private MyApp application;
|
MyApp application;
|
||||||
private Activity_base oContext;
|
private Activity_base oContext;
|
||||||
protected Gson gson = new Gson();
|
protected Gson gson = new Gson();
|
||||||
protected long mLastBannerTime =0;
|
protected long mLastBannerTime =0;
|
||||||
|
@ -179,7 +179,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
|
||||||
if(mBannerContainer==null){
|
if(mBannerContainer==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(Constants.AD_SETTING.isShowAdsense()){
|
if(Constants.AD_SETTING.isShowAdsense() && Constants.AD_SETTING.getBigBanner().isShow() && NetUtil.isNetworkConnected()){
|
||||||
loadNativeBannerAd();
|
loadNativeBannerAd();
|
||||||
mBannerContainer.setVisibility(View.VISIBLE);
|
mBannerContainer.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class Activity_cache extends Activity_base {
|
||||||
if( mData.size()>0){
|
if( mData.size()>0){
|
||||||
tvMsg.setText(String.format("共有%s条下载记录",mData.size()));
|
tvMsg.setText(String.format("共有%s条下载记录",mData.size()));
|
||||||
}else{
|
}else{
|
||||||
tvMsg.setText("您还没有没有缓存过小说");
|
tvMsg.setText(R.string.noRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ public class Activity_cache extends Activity_base {
|
||||||
private List<DownloadTask> mDatas = new ArrayList<DownloadTask>();
|
private List<DownloadTask> mDatas = new ArrayList<DownloadTask>();
|
||||||
private OnItemClickLitener mOnItemClickLitener;
|
private OnItemClickLitener mOnItemClickLitener;
|
||||||
private int listItemID;
|
private int listItemID;
|
||||||
private String norecord ="还没有下载记录";
|
// private String norecord ="还没有下载记录";
|
||||||
|
|
||||||
public CacheAdapter(Context context, List<DownloadTask> mDatas, int listItemID, OnItemClickLitener clickLitener) {
|
public CacheAdapter(Context context, List<DownloadTask> mDatas, int listItemID, OnItemClickLitener clickLitener) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
@ -302,7 +302,7 @@ public class Activity_cache extends Activity_base {
|
||||||
if (hd instanceof EmptyViewHolder) {
|
if (hd instanceof EmptyViewHolder) {
|
||||||
EmptyViewHolder holder = ( EmptyViewHolder)hd;
|
EmptyViewHolder holder = ( EmptyViewHolder)hd;
|
||||||
holder.tvEmpty.setVisibility(View.VISIBLE);
|
holder.tvEmpty.setVisibility(View.VISIBLE);
|
||||||
holder.tvEmpty.setText(norecord);
|
holder.tvEmpty.setText(R.string.noRecord);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MyViewHolder holder = ( MyViewHolder)hd;
|
MyViewHolder holder = ( MyViewHolder)hd;
|
||||||
|
|
|
@ -65,11 +65,15 @@ import com.novelbook.android.utils.ImageUtil;
|
||||||
import com.novelbook.android.utils.MyImageLoader;
|
import com.novelbook.android.utils.MyImageLoader;
|
||||||
import com.novelbook.android.utils.OnItemClickListener;
|
import com.novelbook.android.utils.OnItemClickListener;
|
||||||
import com.novelbook.android.utils.PageFactory;
|
import com.novelbook.android.utils.PageFactory;
|
||||||
|
import com.qq.e.ads.nativ.ADSize;
|
||||||
import com.qq.e.ads.nativ.NativeADUnifiedListener;
|
import com.qq.e.ads.nativ.NativeADUnifiedListener;
|
||||||
import com.qq.e.ads.nativ.NativeExpressAD;
|
import com.qq.e.ads.nativ.NativeExpressAD;
|
||||||
|
import com.qq.e.ads.nativ.NativeExpressADView;
|
||||||
import com.qq.e.ads.nativ.NativeUnifiedAD;
|
import com.qq.e.ads.nativ.NativeUnifiedAD;
|
||||||
import com.qq.e.ads.nativ.NativeUnifiedADData;
|
import com.qq.e.ads.nativ.NativeUnifiedADData;
|
||||||
|
import com.qq.e.comm.constants.AdPatternType;
|
||||||
import com.qq.e.comm.util.AdError;
|
import com.qq.e.comm.util.AdError;
|
||||||
|
import com.qq.e.comm.util.GDTLogger;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.youth.banner.loader.ImageLoader;
|
import com.youth.banner.loader.ImageLoader;
|
||||||
|
|
||||||
|
@ -91,7 +95,7 @@ import static com.novelbook.android.utils.AdUtil.getAppID;
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
*/
|
*/
|
||||||
public abstract class BasicFragment extends Fragment implements NativeADUnifiedListener {
|
public abstract class BasicFragment extends Fragment implements /* NativeADUnifiedListener,*/NativeExpressAD.NativeExpressADListener {
|
||||||
|
|
||||||
private static String TAG = BasicFragment.class.getSimpleName();
|
private static String TAG = BasicFragment.class.getSimpleName();
|
||||||
protected View rootView;
|
protected View rootView;
|
||||||
|
@ -459,13 +463,14 @@ void initTabs(){
|
||||||
error_try=0;
|
error_try=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------toutiao ad------
|
//---------banner ad------
|
||||||
public void showBanner( FrameLayout bannerContainer , int adHeight ) {
|
public void showBanner( FrameLayout bannerContainer , int adHeight ) {
|
||||||
if(bannerContainer==null){
|
if(bannerContainer==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// bannerContainer.setVisibility(View.GONE);
|
// bannerContainer.setVisibility(View.GONE);
|
||||||
if (!Constants.AD_SETTING.isShowAdsense()) {
|
if (!Constants.AD_SETTING.isShowAdsense() || !Constants.AD_SETTING.getFixBanner().isShow() || !NetUtil.isNetworkConnected()) {
|
||||||
|
mBannerContainer.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,7 +480,7 @@ void initTabs(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// qq ad ------------------------------begin
|
// qq ad ------------------------------begin
|
||||||
private NativeUnifiedAD mAdManager;
|
/* private NativeUnifiedAD mAdManager;
|
||||||
private List<NativeUnifiedADData> mAds = new ArrayList<>();
|
private List<NativeUnifiedADData> mAds = new ArrayList<>();
|
||||||
public void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
|
public void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
|
||||||
if(mAdManager==null) {
|
if(mAdManager==null) {
|
||||||
|
@ -488,11 +493,12 @@ void initTabs(){
|
||||||
qqAdapter =adapter;
|
qqAdapter =adapter;
|
||||||
qqAddFooter=addFooter;
|
qqAddFooter=addFooter;
|
||||||
Log.d(TAG, "loadListAd_qq: ad requested");
|
Log.d(TAG, "loadListAd_qq: ad requested");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
private boolean qqAddFooter;
|
private boolean qqAddFooter;
|
||||||
private BookListAdapter qqAdapter;
|
private BookListAdapter qqAdapter;
|
||||||
@Override
|
/* @Override
|
||||||
public void onADLoaded(List<NativeUnifiedADData> ads) {
|
public void onADLoaded(List<NativeUnifiedADData> ads) {
|
||||||
Log.d(TAG, "loadListAd_qq: ad onADLoaded,qqAddFooter? "+qqAddFooter);
|
Log.d(TAG, "loadListAd_qq: ad onADLoaded,qqAddFooter? "+qqAddFooter);
|
||||||
// mIsLoading = false;
|
// mIsLoading = false;
|
||||||
|
@ -506,7 +512,7 @@ void initTabs(){
|
||||||
}else{
|
}else{
|
||||||
qqAdapter.AddHeaderItem(ads);
|
qqAdapter.AddHeaderItem(ads);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
@Override
|
@Override
|
||||||
public void onNoAD(AdError adError) {
|
public void onNoAD(AdError adError) {
|
||||||
Log.d(TAG, "loadListAd_qq: ad onNoAD " );
|
Log.d(TAG, "loadListAd_qq: ad onNoAD " );
|
||||||
|
@ -516,6 +522,88 @@ void initTabs(){
|
||||||
adError.getErrorMsg()));
|
adError.getErrorMsg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NativeExpressAD mADManager;
|
||||||
|
void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
|
||||||
|
ADSize adSize = new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT); // 消息流中用AUTO_HEIGHT
|
||||||
|
mADManager = new NativeExpressAD(activity, adSize, getAppID(Constants.AD_TENCENT_QQ),
|
||||||
|
Constants.AD_SETTING.getInformationFlow().getSlotId(Constants.AD_TENCENT_QQ), this);
|
||||||
|
mADManager.setMaxVideoDuration(5);
|
||||||
|
mADManager.loadAD(adCnt);
|
||||||
|
qqAdapter =adapter;
|
||||||
|
qqAddFooter=addFooter;
|
||||||
|
Log.d(TAG, "loadListAd_qq: ad requested");
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onADLoaded(List<NativeExpressADView> adList) {
|
||||||
|
Log.i(TAG, "onADLoaded: " + adList.size());
|
||||||
|
/* mAdViewList = adList;
|
||||||
|
for (int i = 0; i < mAdViewList.size(); i++) {
|
||||||
|
int position = FIRST_AD_POSITION + ITEMS_PER_AD * i;
|
||||||
|
if (position < mNormalDataList.size()) {
|
||||||
|
NativeExpressADView view = mAdViewList.get(i);
|
||||||
|
GDTLogger.i("ad load[" + i + "]: " + getAdInfo(view));
|
||||||
|
if (view.getBoundData().getAdPatternType() == AdPatternType.NATIVE_VIDEO) {
|
||||||
|
view.setMediaListener(mediaListener);
|
||||||
|
}
|
||||||
|
mAdViewPositionMap.put(view, position); // 把每个广告在列表中位置记录下来
|
||||||
|
mAdapter.addADViewToPosition(position, mAdViewList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mAdapter.notifyDataSetChanged();*/
|
||||||
|
if(qqAdapter==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(qqAddFooter) {
|
||||||
|
qqAdapter.AddFooterItem(adList);
|
||||||
|
}else{
|
||||||
|
qqAdapter.AddHeaderItem(adList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onRenderFail(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onRenderFail: " + adView.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRenderSuccess(NativeExpressADView adView) {
|
||||||
|
// Log.i(TAG, "onRenderSuccess: " + adView.toString() + ", adInfo: " + getAdInfo(adView));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADExposure(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADExposure: " + adView.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADClicked(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADClicked: " + adView.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADClosed(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADClosed: " + adView.toString());
|
||||||
|
/* if (mAdapter != null) {
|
||||||
|
int removedPosition = mAdViewPositionMap.get(adView);
|
||||||
|
mAdapter.removeADView(removedPosition, adView);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADLeftApplication(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADLeftApplication: " + adView.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADOpenOverlay(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADOpenOverlay: " + adView.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onADCloseOverlay(NativeExpressADView adView) {
|
||||||
|
Log.i(TAG, "onADCloseOverlay");
|
||||||
|
}
|
||||||
|
|
||||||
//qq ad end<-------------
|
//qq ad end<-------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -453,6 +453,7 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
|
|
||||||
@OnClick({R.id.btnSelect, R.id.btnDelete})
|
@OnClick({R.id.btnSelect, R.id.btnDelete})
|
||||||
void shelfZhengliSubmit(View view) {
|
void shelfZhengliSubmit(View view) {
|
||||||
|
|
||||||
if (view.getId() == R.id.btnSelect) {
|
if (view.getId() == R.id.btnSelect) {
|
||||||
|
|
||||||
if (isSelectAll) {
|
if (isSelectAll) {
|
||||||
|
@ -468,7 +469,29 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
mChkAdapter.notifyDataSetChanged();
|
mChkAdapter.notifyDataSetChanged();
|
||||||
} else if (view.getId() == R.id.btnDelete) {
|
} else if (view.getId() == R.id.btnDelete) {
|
||||||
|
|
||||||
|
boolean isChecked = false;
|
||||||
|
for(boolean b :flag){
|
||||||
|
if(b) {
|
||||||
|
isChecked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isChecked){
|
||||||
|
new AlertDialog.Builder(activity)
|
||||||
|
.setTitle(this.getString(R.string.app_name))
|
||||||
|
.setMessage( "您还没有选择要移除的书籍")
|
||||||
|
.setNegativeButton("确定", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
.setCancelable(false).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
new AlertDialog.Builder(activity)
|
new AlertDialog.Builder(activity)
|
||||||
.setTitle(this.getString(R.string.app_name))
|
.setTitle(this.getString(R.string.app_name))
|
||||||
.setMessage( "您将从书架移除选中的书籍,是否继续?")
|
.setMessage( "您将从书架移除选中的书籍,是否继续?")
|
||||||
|
@ -500,15 +523,16 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
nv.update(nv.getId());
|
nv.update(nv.getId());
|
||||||
// nv.update(nv.getId()); //not work,,,If you set a default value to a field, the corresponding column won't be updated.
|
// nv.update(nv.getId()); //not work,,,If you set a default value to a field, the corresponding column won't be updated.
|
||||||
}
|
}
|
||||||
bookLists = Novel.getNovelsOnShelf();
|
|
||||||
flag = new boolean[bookLists.size()];
|
|
||||||
zhengliShelf();
|
|
||||||
initData();
|
|
||||||
// flag = new boolean[bookLists.size()];
|
// flag = new boolean[bookLists.size()];
|
||||||
// bookLists.remove(i);
|
// bookLists.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
btnSelectAll.setText("全选");
|
||||||
|
bookLists = Novel.getNovelsOnShelf();
|
||||||
|
flag = new boolean[bookLists.size()];
|
||||||
|
zhengliShelf();
|
||||||
|
initData();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setCancelable(false).show();
|
.setCancelable(false).show();
|
||||||
|
@ -533,6 +557,27 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
|
|
||||||
|
|
||||||
private void initZhengliDialog() {
|
private void initZhengliDialog() {
|
||||||
|
if( flag==null || flag.length ==0 ){
|
||||||
|
flag= new boolean[bookLists.size()];
|
||||||
|
}
|
||||||
|
if( flag==null || flag.length ==0 ){
|
||||||
|
new AlertDialog.Builder(activity)
|
||||||
|
.setTitle(this.getString(R.string.app_name))
|
||||||
|
.setMessage( "您书架上还没有书籍可以整理")
|
||||||
|
.setNegativeButton("确定", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
.setCancelable(false).show();
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
zhengliShelf();
|
zhengliShelf();
|
||||||
llShelfBottom.setVisibility(View.VISIBLE);
|
llShelfBottom.setVisibility(View.VISIBLE);
|
||||||
Main2Activity main2Activity = (Main2Activity) activity;
|
Main2Activity main2Activity = (Main2Activity) activity;
|
||||||
|
|
|
@ -192,32 +192,7 @@ public class Fragment_booklist extends BasicFragment {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
mData = new ArrayList<Novel>();
|
initialDataAdapter();
|
||||||
mAdapter = new BookListAdapter(activity, mData, listItem, new OnItemClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(View view, int position) {
|
|
||||||
if(mData.get(position) instanceof Novel)
|
|
||||||
showBookDetail((Novel)mData.get(position));
|
|
||||||
// openBook(mData.get(position),mAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemLongClick(View view, int position) {
|
|
||||||
// initDialog(position);
|
|
||||||
// mAdapter.removeData(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLinearOutClick(View view, int position, int llId) {
|
|
||||||
Toast.makeText(activity, "book " + position + " clicked",
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAdapter.setShowFootView(true);
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(activity));
|
|
||||||
mRecyclerView.setAdapter(mAdapter);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* if(mAdapter!=null){
|
/* if(mAdapter!=null){
|
||||||
|
@ -311,6 +286,36 @@ public class Fragment_booklist extends BasicFragment {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initialDataAdapter() {
|
||||||
|
mData = new ArrayList<Novel>();
|
||||||
|
mAdapter = new BookListAdapter(activity, mData, listItem, new OnItemClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(View view, int position) {
|
||||||
|
if(mData.get(position) instanceof Novel)
|
||||||
|
showBookDetail((Novel)mData.get(position));
|
||||||
|
// openBook(mData.get(position),mAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemLongClick(View view, int position) {
|
||||||
|
// initDialog(position);
|
||||||
|
// mAdapter.removeData(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLinearOutClick(View view, int position, int llId) {
|
||||||
|
Toast.makeText(activity, "book " + position + " clicked",
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mAdapter.setShowFootView(true);
|
||||||
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(activity));
|
||||||
|
mRecyclerView.setAdapter(mAdapter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initViews(){
|
public void initViews(){
|
||||||
//mRecyclerView
|
//mRecyclerView
|
||||||
|
@ -367,6 +372,7 @@ public class Fragment_booklist extends BasicFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
void loadHistory(){
|
void loadHistory(){
|
||||||
|
initialDataAdapter();
|
||||||
new Thread() {
|
new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -374,9 +380,10 @@ public class Fragment_booklist extends BasicFragment {
|
||||||
|
|
||||||
mMoreData = Novel.getNovelsHistory();
|
mMoreData = Novel.getNovelsHistory();
|
||||||
setPageCount(1);
|
setPageCount(1);
|
||||||
|
//
|
||||||
handler.sendEmptyMessage(1);
|
handler.sendEmptyMessage(1);
|
||||||
if(mMoreData!=null && mMoreData.size()>2) {
|
if(mMoreData!=null && mMoreData.size()>5) {
|
||||||
loadListAd(mAdapter, 2, mData.size() > 0);
|
loadListAd(mAdapter, 1, mData.size() > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
|
|
@ -60,7 +60,7 @@ import static com.novelbook.android.FileActivity.EXTERNAL_STORAGE_REQ_CODE;
|
||||||
|
|
||||||
public class Main2Activity extends Activity_base
|
public class Main2Activity extends Activity_base
|
||||||
implements NavigationView.OnNavigationItemSelectedListener{//} , BasicFragment.OnFragmentInteractionListener {
|
implements NavigationView.OnNavigationItemSelectedListener{//} , BasicFragment.OnFragmentInteractionListener {
|
||||||
public MyApp app ;
|
// public MyApp app ;
|
||||||
public static final String TAG =Main2Activity.class.getSimpleName();
|
public static final String TAG =Main2Activity.class.getSimpleName();
|
||||||
|
|
||||||
// @BindView(R.id.fab)
|
// @BindView(R.id.fab)
|
||||||
|
@ -89,17 +89,18 @@ public class Main2Activity extends Activity_base
|
||||||
public static volatile Activity activityContext = null;
|
public static volatile Activity activityContext = null;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
NetUtil.getHostPolicy();
|
NetUtil.getHostPolicy();
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
activityContext =this;
|
activityContext =this;
|
||||||
//PageFactory.createPageFactory(this);
|
//PageFactory.createPageFactory(this);
|
||||||
app =(MyApp) getApplicationContext();
|
|
||||||
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
||||||
config =Config.getInstance();
|
config =Config.getInstance();
|
||||||
// ButterKnife.bind(this);
|
// ButterKnife.bind(this);
|
||||||
|
|
||||||
initialSexOption();
|
initialSexOption();
|
||||||
// checkUpdate(true);
|
//checkUpdate(true);
|
||||||
CommonUtil.getSearchTabTtitle(this);
|
CommonUtil.getSearchTabTtitle(this);
|
||||||
DisplayMetrics metric = new DisplayMetrics();
|
DisplayMetrics metric = new DisplayMetrics();
|
||||||
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
@ -445,7 +446,7 @@ private int bottomSelectedIndex;
|
||||||
// return super.onKeyUp(keyCode, event);
|
// return super.onKeyUp(keyCode, event);
|
||||||
// return false;
|
// return false;
|
||||||
finish();
|
finish();
|
||||||
app.exit();
|
application.exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
|
|
|
@ -101,7 +101,14 @@ public class MyApp extends Application {
|
||||||
if (!oList.contains(activity)) {
|
if (!oList.contains(activity)) {
|
||||||
oList.add(activity);//把当前Activity添加到集合中
|
oList.add(activity);//把当前Activity添加到集合中
|
||||||
}
|
}
|
||||||
|
currentAct=activity;
|
||||||
}
|
}
|
||||||
|
private static Activity currentAct =null;
|
||||||
|
public static Activity getCurrentActivity(){
|
||||||
|
return currentAct;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -129,8 +129,8 @@ public class ReadActivity extends Activity_base implements AdInterface {
|
||||||
@BindView(R.id.tvUrl)
|
@BindView(R.id.tvUrl)
|
||||||
TextView tvUrl;
|
TextView tvUrl;
|
||||||
|
|
||||||
// @BindView(R.id.top_banner_container)
|
@BindView(R.id.top_banner_container)
|
||||||
// FrameLayout mTopBannerContainer;
|
FrameLayout mTopBannerContainer;
|
||||||
|
|
||||||
@BindView(R.id.imgLoading)
|
@BindView(R.id.imgLoading)
|
||||||
pl.droidsonroids.gif.GifImageView imgLoading;
|
pl.droidsonroids.gif.GifImageView imgLoading;
|
||||||
|
@ -1084,6 +1084,10 @@ public class ReadActivity extends Activity_base implements AdInterface {
|
||||||
return tmpFrame;
|
return tmpFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void initNaviBanner() {
|
||||||
|
|
||||||
|
}
|
||||||
public void hideStatusAds(){
|
public void hideStatusAds(){
|
||||||
|
|
||||||
/* try{
|
/* try{
|
||||||
|
@ -1131,6 +1135,7 @@ public class ReadActivity extends Activity_base implements AdInterface {
|
||||||
// mBannerContainer.removeAllViews();
|
// mBannerContainer.removeAllViews();
|
||||||
// mBannerContainer.setBackgroundResource(R.color.transparent);
|
// mBannerContainer.setBackgroundResource(R.color.transparent);
|
||||||
hideAdSlot(mBannerContainer);
|
hideAdSlot(mBannerContainer);
|
||||||
|
hideAdSlot(mNative_status_banner_container);
|
||||||
if(height<=0){
|
if(height<=0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1138,7 +1143,7 @@ public class ReadActivity extends Activity_base implements AdInterface {
|
||||||
if( adY >390*Constants.ONE_DP_SIZE){
|
if( adY >390*Constants.ONE_DP_SIZE){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hideAdSlot(mTopBannerContainer);
|
||||||
if(mBannerContainer.getChildCount()>0) {
|
if(mBannerContainer.getChildCount()>0) {
|
||||||
mBannerContainer.removeAllViews();
|
mBannerContainer.removeAllViews();
|
||||||
Log.d(TAG, "loadBannerAd: hideAdSlot()");
|
Log.d(TAG, "loadBannerAd: hideAdSlot()");
|
||||||
|
@ -1163,21 +1168,26 @@ public class ReadActivity extends Activity_base implements AdInterface {
|
||||||
// mTopBannerContainer.setVisibility(View.INVISIBLE);//翻页引起抖动
|
// mTopBannerContainer.setVisibility(View.INVISIBLE);//翻页引起抖动
|
||||||
//mTopBannerContainer.removeAllViews();
|
//mTopBannerContainer.removeAllViews();
|
||||||
// Log.d(TAG, String.format("loadBannerAd:showTopBanner width %s, height %s ,adY %s ",Constants.SCREEN_WIDTH_PIX-50,adHeight,adY));
|
// Log.d(TAG, String.format("loadBannerAd:showTopBanner width %s, height %s ,adY %s ",Constants.SCREEN_WIDTH_PIX-50,adHeight,adY));
|
||||||
tmpFrame =mBannerContainer;
|
tmpFrame =mTopBannerContainer;
|
||||||
// hideAdSlot(mBannerContainer);
|
// hideAdSlot(mBannerContainer);
|
||||||
|
|
||||||
|
hideAdSlot(mBannerContainer);
|
||||||
|
hideAdSlot(mNative_status_banner_container);
|
||||||
if(adHeight<=0){
|
if(adHeight<=0){
|
||||||
|
hideAdSlot(mTopBannerContainer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int topMargin = adY >200*Constants.ONE_DP_SIZE ? adY -15*Constants.ONE_DP_SIZE :adY -5*Constants.ONE_DP_SIZE;
|
int topMargin = adY >200*Constants.ONE_DP_SIZE ? adY -15*Constants.ONE_DP_SIZE :adY -5*Constants.ONE_DP_SIZE;
|
||||||
Log.d(TAG, String.format("loadBannerAd:showTopBanner width %s, height %s ,adY %s ",Constants.SCREEN_WIDTH_PIX-50,adHeight,adY));
|
Log.d(TAG, String.format("loadBannerAd:showTopBanner width %s, height %s ,adY %s ",Constants.SCREEN_WIDTH_PIX-50,adHeight,adY));
|
||||||
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mBannerContainer.getLayoutParams();
|
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mTopBannerContainer.getLayoutParams();
|
||||||
loadBanner(mBannerContainer, Constants.SCREEN_WIDTH_PIX-50,adHeight);
|
loadBanner(mTopBannerContainer, Constants.SCREEN_WIDTH_PIX-50,adHeight);
|
||||||
// loadNativeBannerAd(mTopBannerContainer,BuildConfig.AD_SLOT_TOUTIAO_BANNER_NATIVE_ID, 304,200);
|
// loadNativeBannerAd(mTopBannerContainer,BuildConfig.AD_SLOT_TOUTIAO_BANNER_NATIVE_ID, 304,200);
|
||||||
params.setMargins(10*Constants.ONE_DP_SIZE, topMargin, 10*Constants.ONE_DP_SIZE, 0 );
|
params.setMargins(10*Constants.ONE_DP_SIZE, topMargin, 10*Constants.ONE_DP_SIZE, 0 );
|
||||||
params.width =-1;
|
params.width =-1;
|
||||||
params.height = (int) getResources().getDimension(R.dimen.topBannerHeight);
|
params.height = (int) getResources().getDimension(R.dimen.topBannerHeight);
|
||||||
mBannerContainer.setLayoutParams(params);
|
mTopBannerContainer.setLayoutParams(params);
|
||||||
showAdSlot(mBannerContainer);
|
showAdSlot(mTopBannerContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import com.novelbook.android.utils.CommonUtil;
|
||||||
import com.novelbook.android.utils.ImageUtil;
|
import com.novelbook.android.utils.ImageUtil;
|
||||||
import com.novelbook.android.utils.MyImageLoader;
|
import com.novelbook.android.utils.MyImageLoader;
|
||||||
import com.novelbook.android.utils.OnItemClickListener;
|
import com.novelbook.android.utils.OnItemClickListener;
|
||||||
|
import com.qq.e.ads.nativ.NativeExpressADView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -60,7 +61,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
|
||||||
private static final int ITEM_VIEW_TYPE_SMALL_PIC_AD = 6;
|
private static final int ITEM_VIEW_TYPE_SMALL_PIC_AD = 6;
|
||||||
private static final int ITEM_VIEW_TYPE_LARGE_PIC_AD = 7;
|
private static final int ITEM_VIEW_TYPE_LARGE_PIC_AD = 7;
|
||||||
private static final int ITEM_VIEW_TYPE_VIDEO = 8;
|
private static final int ITEM_VIEW_TYPE_VIDEO = 8;
|
||||||
|
private static final int ITEM_VIEW_TYPE_QQ_NATIVE_EXPRESS = 9;
|
||||||
|
|
||||||
|
|
||||||
// private MyImageLoader loader = new MyImageLoader();
|
// private MyImageLoader loader = new MyImageLoader();
|
||||||
|
@ -162,9 +163,12 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
|
||||||
return ITEM_VIEW_TYPE_VIDEO;
|
return ITEM_VIEW_TYPE_VIDEO;
|
||||||
}
|
}
|
||||||
return ITEM_VIEW_TYPE_SMALL_PIC_AD;
|
return ITEM_VIEW_TYPE_SMALL_PIC_AD;
|
||||||
|
}else if(mDatas.get(position) instanceof NativeExpressADView ){
|
||||||
|
return ITEM_VIEW_TYPE_QQ_NATIVE_EXPRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if ( position == mDatas.size()) {
|
}
|
||||||
|
else if ( position == mDatas.size()) {
|
||||||
//最后一个item设置为footerView
|
//最后一个item设置为footerView
|
||||||
if(!showFootView){
|
if(!showFootView){
|
||||||
return NO_FOOTER;
|
return NO_FOOTER;
|
||||||
|
@ -201,6 +205,10 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
|
||||||
return new GroupAdViewHolder(mInflater.inflate(R.layout.listitem_ad_group_pic, parent, false));
|
return new GroupAdViewHolder(mInflater.inflate(R.layout.listitem_ad_group_pic, parent, false));
|
||||||
case ITEM_VIEW_TYPE_VIDEO:
|
case ITEM_VIEW_TYPE_VIDEO:
|
||||||
return new VideoAdViewHolder(mInflater.inflate(R.layout.listitem_ad_large_video, parent, false));
|
return new VideoAdViewHolder(mInflater.inflate(R.layout.listitem_ad_large_video, parent, false));
|
||||||
|
case ITEM_VIEW_TYPE_QQ_NATIVE_EXPRESS:
|
||||||
|
|
||||||
|
return new QQ_ExpressViewHolder(mInflater.inflate(R.layout.listitem_ad_qq_item_express, parent, false));
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new MyViewHolder( mInflater.inflate(listItemID, parent, false));
|
return new MyViewHolder( mInflater.inflate(listItemID, parent, false));
|
||||||
}
|
}
|
||||||
|
@ -254,8 +262,27 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
|
||||||
EmptyViewHolder holder = (EmptyViewHolder)hd;
|
EmptyViewHolder holder = (EmptyViewHolder)hd;
|
||||||
holder.tvEmpty.setVisibility(View.VISIBLE);
|
holder.tvEmpty.setVisibility(View.VISIBLE);
|
||||||
holder.tvEmpty.setText(norecord);
|
holder.tvEmpty.setText(norecord);
|
||||||
}
|
}else if (hd instanceof QQ_ExpressViewHolder) {
|
||||||
|
QQ_ExpressViewHolder holder = (QQ_ExpressViewHolder)hd;
|
||||||
|
// holder.title.setVisibility(View.VISIBLE);
|
||||||
|
final NativeExpressADView adView = (NativeExpressADView) mDatas.get(position);
|
||||||
|
// mAdViewPositionMap.put(adView, position); // 广告在列表中的位置是可以被更新的
|
||||||
|
if (holder.container.getChildCount() > 0
|
||||||
|
&& holder.container.getChildAt(0) == adView) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.container.getChildCount() > 0) {
|
||||||
|
holder.container.removeAllViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (adView.getParent() != null) {
|
||||||
|
((ViewGroup) adView.getParent()).removeView(adView);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.container.addView(adView);
|
||||||
|
adView.render(); // 调用render方法后sdk才会开始展示广告
|
||||||
|
}
|
||||||
|
|
||||||
else if (hd instanceof MyViewHolder && mDatas.get(position) instanceof Novel) {
|
else if (hd instanceof MyViewHolder && mDatas.get(position) instanceof Novel) {
|
||||||
|
|
||||||
|
@ -623,6 +650,19 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
|
||||||
super(itemView);
|
super(itemView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class QQ_ExpressViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
// public TextView title;
|
||||||
|
public ViewGroup container;
|
||||||
|
|
||||||
|
public QQ_ExpressViewHolder(View view) {
|
||||||
|
super(view);
|
||||||
|
// title = (TextView) view.findViewById(R.id.title);
|
||||||
|
container = (ViewGroup) view.findViewById(R.id.express_ad_container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void bindData(final AdViewHolder adViewHolder, TTFeedAd ad) {
|
private void bindData(final AdViewHolder adViewHolder, TTFeedAd ad) {
|
||||||
//可以被点击的view, 也可以把convertView放进来意味item可被点击
|
//可以被点击的view, 也可以把convertView放进来意味item可被点击
|
||||||
List<View> clickViewList = new ArrayList<>();
|
List<View> clickViewList = new ArrayList<>();
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package com.novelbook.android.bean;
|
package com.novelbook.android.bean;
|
||||||
|
|
||||||
|
import com.novelbook.android.netutils.NetUtil;
|
||||||
|
|
||||||
public class AdSetting {
|
public class AdSetting {
|
||||||
|
private boolean showAdsense;
|
||||||
private String[] appIds={};
|
private String[] appIds={};
|
||||||
private slot splash = new slot();
|
private slot splash = new slot();
|
||||||
private slot splash2 = new slot();
|
private slot splash2 = new slot();
|
||||||
|
@ -9,10 +12,10 @@ public class AdSetting {
|
||||||
private slot chapterContentBanner = new slot();
|
private slot chapterContentBanner = new slot();
|
||||||
private slot chapterEndBanner = new slot();
|
private slot chapterEndBanner = new slot();
|
||||||
private slot pop = new slot();
|
private slot pop = new slot();
|
||||||
private boolean showAdsense;
|
private slot fixBanner = new slot();
|
||||||
|
private slot bigBanner = new slot();
|
||||||
public boolean isShowAdsense() {
|
public boolean isShowAdsense() {
|
||||||
return true;//showAdsense;
|
return showAdsense && NetUtil.isNetworkConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowAdsense(boolean showAdsense) {
|
public void setShowAdsense(boolean showAdsense) {
|
||||||
|
@ -51,8 +54,15 @@ public class AdSetting {
|
||||||
return pop;
|
return pop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public slot getFixBanner() {
|
||||||
|
return fixBanner;
|
||||||
|
}
|
||||||
|
|
||||||
public class slot{
|
public slot getBigBanner() {
|
||||||
|
return bigBanner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class slot{
|
||||||
private boolean show;
|
private boolean show;
|
||||||
private int source;
|
private int source;
|
||||||
private int interval4Display;
|
private int interval4Display;
|
||||||
|
@ -71,7 +81,7 @@ public class slot{
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShow() {
|
public boolean isShow() {
|
||||||
return show;
|
return show && NetUtil.isNetworkConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShow(boolean show) {
|
public void setShow(boolean show) {
|
||||||
|
@ -79,8 +89,8 @@ public class slot{
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSource() {
|
public int getSource() {
|
||||||
// return source;
|
return source;
|
||||||
return 1;
|
// return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSource(int source) {
|
public void setSource(int source) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.graphics.pdf.PdfDocument;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -28,10 +29,12 @@ import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.novelbook.android.MyApp;
|
||||||
import com.novelbook.android.R;
|
import com.novelbook.android.R;
|
||||||
import com.novelbook.android.ReadActivity;
|
import com.novelbook.android.ReadActivity;
|
||||||
import com.novelbook.android.db.Novel;
|
import com.novelbook.android.db.Novel;
|
||||||
import com.novelbook.android.utils.FileUtils;
|
import com.novelbook.android.utils.FileUtils;
|
||||||
|
import com.novelbook.android.utils.PageFactory;
|
||||||
|
|
||||||
|
|
||||||
import org.litepal.LitePal;
|
import org.litepal.LitePal;
|
||||||
|
@ -644,12 +647,16 @@ public class DirectoryFragment extends Fragment implements View.OnClickListener
|
||||||
for (Novel book : bookLists){
|
for (Novel book : bookLists){
|
||||||
if (book.getNovelPath().equals(bookList.getNovelPath())){
|
if (book.getNovelPath().equals(bookList.getNovelPath())){
|
||||||
isSave = true;
|
isSave = true;
|
||||||
|
bookList =book;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isSave){
|
if (!isSave){
|
||||||
bookList.save();
|
bookList.save();
|
||||||
}
|
}
|
||||||
|
// PageFactory.getInstance(MyApp.applicationContext).prepareBook(bookList);
|
||||||
|
|
||||||
ReadActivity.openBook(bookList, getActivity());
|
ReadActivity.openBook(bookList, getActivity());
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class FileChooserActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(R.menu.file, menu);
|
// getMenuInflater().inflate(R.menu.file, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class HttpMethods {
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
|
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||||
//设置 Debug Log 模式
|
//设置 Debug Log 模式
|
||||||
okHttpBuilder.addInterceptor(loggingInterceptor);
|
okHttpBuilder.addInterceptor(loggingInterceptor);
|
||||||
// okHttpBuilder.addInterceptor(new RetryInterceptor());
|
// okHttpBuilder.addInterceptor(new RetryInterceptor());
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.novelbook.android.netutils;
|
package com.novelbook.android.netutils;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
|
@ -12,6 +13,7 @@ import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
|
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
|
||||||
import com.novelbook.android.BookActivity;
|
import com.novelbook.android.BookActivity;
|
||||||
|
import com.novelbook.android.BuildConfig;
|
||||||
import com.novelbook.android.Main2Activity;
|
import com.novelbook.android.Main2Activity;
|
||||||
import com.novelbook.android.MyApp;
|
import com.novelbook.android.MyApp;
|
||||||
import com.novelbook.android.bean.AdSetting;
|
import com.novelbook.android.bean.AdSetting;
|
||||||
|
@ -317,10 +319,13 @@ public class NetUtil {
|
||||||
String systemVersion = CommonUtil.getSystemVersion();
|
String systemVersion = CommonUtil.getSystemVersion();
|
||||||
String deviceBrand = CommonUtil.getDeviceBrand();
|
String deviceBrand = CommonUtil.getDeviceBrand();
|
||||||
String packagenm = CommonUtil.getPackageName(context);
|
String packagenm = CommonUtil.getPackageName(context);
|
||||||
userAgent = "Android/" + versionName + "/"+packagenm+"/" + deviceBrand + "/" + systemModel + "/" + systemVersion;
|
|
||||||
|
String channel =CommonUtil.getChannel(context);// BuildConfig.CHANNEL;
|
||||||
|
userAgent = "Android/" +channel +"/"+ versionName + "/"+packagenm+"/" + deviceBrand + "/" + systemModel + "/" + systemVersion;
|
||||||
return userAgent;
|
return userAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getHostPolicy(){
|
public static void getHostPolicy(){
|
||||||
if(isRequestHosts){
|
if(isRequestHosts){
|
||||||
return;
|
return;
|
||||||
|
@ -432,7 +437,11 @@ public class NetUtil {
|
||||||
}
|
}
|
||||||
public static void checkUpdate(boolean isSilence){
|
public static void checkUpdate(boolean isSilence){
|
||||||
|
|
||||||
UpdateManager manager = new UpdateManager(Main2Activity.activityContext);
|
Activity currentActivity = MyApp.getCurrentActivity();
|
||||||
|
if(currentActivity==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateManager manager = new UpdateManager(currentActivity);
|
||||||
if(isSilence)
|
if(isSilence)
|
||||||
manager.checkUpdateSilence();
|
manager.checkUpdateSilence();
|
||||||
else
|
else
|
||||||
|
|
|
@ -62,6 +62,11 @@ public class RetryInterceptor implements Interceptor {
|
||||||
boolean isMainApi =path.equals("/api/g/");
|
boolean isMainApi =path.equals("/api/g/");
|
||||||
if(oldUrl.indexOf("xiaoshuofenxiang.com") == -1 || !path.startsWith("/api/") || NetUtil.getHost(isMainApi)==null){
|
if(oldUrl.indexOf("xiaoshuofenxiang.com") == -1 || !path.startsWith("/api/") || NetUtil.getHost(isMainApi)==null){
|
||||||
// rh = null;
|
// rh = null;
|
||||||
|
if(oldUrl.indexOf("xiaoshuofenxiang.com")!=-1) {
|
||||||
|
Request.Builder requestBuilder = request.newBuilder();
|
||||||
|
requestBuilder.removeHeader("User-Agent").addHeader("User-Agent", HttpMethods.LOCALUSERAGENT);
|
||||||
|
request =requestBuilder.build();
|
||||||
|
}
|
||||||
|
|
||||||
Response response = doRequest(chain, request);
|
Response response = doRequest(chain, request);
|
||||||
if(response!=null)
|
if(response!=null)
|
||||||
|
@ -137,7 +142,7 @@ public class RetryInterceptor implements Interceptor {
|
||||||
|
|
||||||
response = doRequest(chain, newRequest);
|
response = doRequest(chain, newRequest);
|
||||||
|
|
||||||
Log.d(TAG, String.format("HttpMethods intercept: %s, response is null? %s",newRequest.url(), response == null));
|
Log.d(TAG, String.format("HttpMethods intercept: %s, response is null? %s, ua %s",newRequest.url(), response == null,newRequest.header("User-Agent")));
|
||||||
|
|
||||||
/* int i=0;
|
/* int i=0;
|
||||||
while((response==null || !response.isSuccessful() )&& i<5){
|
while((response==null || !response.isSuccessful() )&& i<5){
|
||||||
|
@ -217,7 +222,7 @@ public class RetryInterceptor implements Interceptor {
|
||||||
private Response doRequest(Chain chain, Request request) throws IOException {
|
private Response doRequest(Chain chain, Request request) throws IOException {
|
||||||
Response response = null;
|
Response response = null;
|
||||||
|
|
||||||
|
Log.d(TAG, String.format("HttpMethods ua: %s, ua %s",request.url(), request.header("User-Agent")));
|
||||||
try {
|
try {
|
||||||
response = chain.proceed(request);
|
response = chain.proceed(request);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -331,8 +331,8 @@ public class UpdateManager {
|
||||||
builder.setTitle(R.string.soft_update_title);
|
builder.setTitle(R.string.soft_update_title);
|
||||||
}
|
}
|
||||||
String upgradeDetails=mHashMap.get("details");
|
String upgradeDetails=mHashMap.get("details");
|
||||||
String forceRefresh =isForceRefresh? "本地版本过低,请升级新版本\n":"";
|
String forceRefresh =isForceRefresh? "本地版本过低,请升级新版本":"";
|
||||||
builder.setMessage( forceRefresh +mContext.getPackageName() + "\n当前版本:"+getVersionCode(mContext) +"\n"
|
builder.setMessage( forceRefresh +/*mContext.getPackageName() +*/ "\n当前版本:"+getVersionCode(mContext) +"\n"
|
||||||
+"最新版本:"+ serviceCode +"\n"
|
+"最新版本:"+ serviceCode +"\n"
|
||||||
+ mContext.getString(R.string.soft_update_info) + upgradeDetails );
|
+ mContext.getString(R.string.soft_update_info) + upgradeDetails );
|
||||||
builder.setPositiveButton(R.string.soft_update_updatebtn, new OnClickListener()
|
builder.setPositiveButton(R.string.soft_update_updatebtn, new OnClickListener()
|
||||||
|
@ -500,5 +500,6 @@ public class UpdateManager {
|
||||||
|
|
||||||
|
|
||||||
mContext.startActivity(i);
|
mContext.startActivity(i);
|
||||||
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,9 +168,9 @@ public class BookUtil {
|
||||||
|
|
||||||
mChapters = LitePal.where("novelId=?", mNovel.getId() + "").find(Chapter.class);
|
mChapters = LitePal.where("novelId=?", mNovel.getId() + "").find(Chapter.class);
|
||||||
|
|
||||||
for (Chapter c : mChapters) {
|
/* for (Chapter c : mChapters) {
|
||||||
Log.d(TAG, String.format("bookchapter :%s,fileName :%s, chapter Size %s", c.getChapterName(), c.getChapterPath(), c.getLength()));
|
Log.d(TAG, String.format("bookchapter :%s,fileName :%s, chapter Size %s", c.getChapterName(), c.getChapterPath(), c.getLength()));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
chaptCache = new HashMap<Integer, Cache>();
|
chaptCache = new HashMap<Integer, Cache>();
|
||||||
if (mChapters.isEmpty()) { //1. 首次打开 本地导入的书
|
if (mChapters.isEmpty()) { //1. 首次打开 本地导入的书
|
||||||
|
|
|
@ -505,7 +505,7 @@ public class CommonUtil {
|
||||||
String date1 = format1.format(new Date(System.currentTimeMillis()));
|
String date1 = format1.format(new Date(System.currentTimeMillis()));
|
||||||
return date1;// 2012-10-03 23:41:31
|
return date1;// 2012-10-03 23:41:31
|
||||||
}
|
}
|
||||||
private String getChannel(Context context) {
|
public static String getChannel(Context context) {
|
||||||
try {
|
try {
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
ApplicationInfo appInfo = pm.getApplicationInfo(getPackageName(context), PackageManager.GET_META_DATA);
|
ApplicationInfo appInfo = pm.getApplicationInfo(getPackageName(context), PackageManager.GET_META_DATA);
|
||||||
|
|
|
@ -122,10 +122,14 @@ public class FileUtils {
|
||||||
public static long getCacheSize(int noveId) {
|
public static long getCacheSize(int noveId) {
|
||||||
return Fileutil.getDirSize(getNovelDir(noveId));
|
return Fileutil.getDirSize(getNovelDir(noveId));
|
||||||
}
|
}
|
||||||
public static String getCachedSize(){
|
public static String getFormatedCachedSize(){
|
||||||
File f = new File(BookUtil.chapterPath);
|
File f = new File(BookUtil.chapterPath);
|
||||||
return Fileutil.formatFileSize(Fileutil.getDirSize(f));
|
return Fileutil.formatFileSize(Fileutil.getDirSize(f));
|
||||||
}
|
}
|
||||||
|
public static long getCachedSize2(){
|
||||||
|
File f = new File(BookUtil.chapterPath);
|
||||||
|
return Fileutil.getDirSize(f) ;
|
||||||
|
}
|
||||||
public static void clearCache(){
|
public static void clearCache(){
|
||||||
File f = new File(BookUtil.chapterPath);
|
File f = new File(BookUtil.chapterPath);
|
||||||
Fileutil.deleteDir(f);
|
Fileutil.deleteDir(f);
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class HistoryCache {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
List<String> retList = (List)gson.fromJson(history, (new TypeToken<List<String>>() {
|
List<String> retList = (List)gson.fromJson(history, (new TypeToken<List<String>>() {
|
||||||
}).getType());
|
}).getType());
|
||||||
if(retList.size()>9){
|
if(retList!=null && retList.size()>9){
|
||||||
return retList.subList(0,9);
|
return retList.subList(0,9);
|
||||||
}
|
}
|
||||||
return retList;
|
return retList;
|
||||||
|
|
|
@ -500,10 +500,10 @@ public class PageFactory implements ChangeSource{
|
||||||
page.setFirstPage(pageNo==1);
|
page.setFirstPage(pageNo==1);
|
||||||
page.setPageNo(pageNo);
|
page.setPageNo(pageNo);
|
||||||
|
|
||||||
if(Constants.AD_SETTING.getChapterEndBanner().isShow() && length >=chars.length ){
|
/* if(Constants.AD_SETTING.getChapterEndBanner().isShow() && length >=chars.length ){
|
||||||
if(page.getLines().size()< mLineCount/2)
|
if(page.getLines().size()< mLineCount/2)
|
||||||
page.setBannerHeight(0);
|
page.setBannerHeight(0);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
chaptPages.add(page);
|
chaptPages.add(page);
|
||||||
// Log.d(TAG, String.format("prepare book build page %s ready for chapter %s,cost %s",pageNo, chaptId,new Date().getTime()-starttime1));
|
// Log.d(TAG, String.format("prepare book build page %s ready for chapter %s,cost %s",pageNo, chaptId,new Date().getTime()-starttime1));
|
||||||
|
@ -525,8 +525,8 @@ public class PageFactory implements ChangeSource{
|
||||||
// Constants.AD_CHAPT_TOP_BANNER_PER_PAGE_COUNT = 1;
|
// Constants.AD_CHAPT_TOP_BANNER_PER_PAGE_COUNT = 1;
|
||||||
|
|
||||||
|
|
||||||
int bannerPagecnt =-20;// Constants.AD_SETTING.getChapterBanner().getPageCount4Display();
|
int bannerPagecnt = Constants.AD_SETTING.getChapterBanner().getPageCount4Display();
|
||||||
int nativeBannerPageCnt =20;// Constants.AD_SETTING.getChapterContentBanner().getPageCount4Display();
|
int nativeBannerPageCnt = Constants.AD_SETTING.getChapterContentBanner().getPageCount4Display();
|
||||||
if (Constants.AD_SETTING.getChapterContentBanner().isShow() &&
|
if (Constants.AD_SETTING.getChapterContentBanner().isShow() &&
|
||||||
nativeBannerPageCnt > 0 &&
|
nativeBannerPageCnt > 0 &&
|
||||||
mNavtiveBannerPlusCnt >= nativeBannerPageCnt) {
|
mNavtiveBannerPlusCnt >= nativeBannerPageCnt) {
|
||||||
|
@ -547,15 +547,19 @@ public class PageFactory implements ChangeSource{
|
||||||
Log.d(TAG, String.format("getNextChapterPage: pageNo %s, adLines %s,adLine %s, nativeBannerHeight %s",
|
Log.d(TAG, String.format("getNextChapterPage: pageNo %s, adLines %s,adLine %s, nativeBannerHeight %s",
|
||||||
pageNo, adLines, adLine, trPage.getNativeBannerHeight()));
|
pageNo, adLines, adLine, trPage.getNativeBannerHeight()));
|
||||||
}
|
}
|
||||||
} else if (Constants.AD_SETTING.getChapterBanner().isShow()) {
|
}
|
||||||
|
if(trPage.getNativeBannerHeight()==0)
|
||||||
|
if (Constants.AD_SETTING.getChapterBanner().isShow()) {
|
||||||
if (bannerPagecnt <=0 || mSmallBannerPlusCnt < bannerPagecnt) {
|
if (bannerPagecnt <=0 || mSmallBannerPlusCnt < bannerPagecnt) {
|
||||||
mSmallBannerPlusCnt++;
|
mSmallBannerPlusCnt++;
|
||||||
trPage.setBannerHeight((int) mBannerTopHeight);
|
trPage.setBannerHeight((int) mBannerTopHeight);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mSmallBannerMinusCnt--;
|
mSmallBannerMinusCnt--;
|
||||||
if (mSmallBannerMinusCnt <= 0) {
|
if (mSmallBannerMinusCnt < 0) {
|
||||||
mSmallBannerMinusCnt = bannerPagecnt;
|
mSmallBannerMinusCnt = bannerPagecnt;
|
||||||
|
}
|
||||||
|
if (mSmallBannerMinusCnt == 0) {
|
||||||
mSmallBannerPlusCnt = 0;
|
mSmallBannerPlusCnt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -921,11 +925,11 @@ private void hideSysUI(){
|
||||||
float adY =targetRect.top +250;
|
float adY =targetRect.top +250;
|
||||||
|
|
||||||
if(showAd)
|
if(showAd)
|
||||||
while(!showingStatusAd || new Date().getTime() - showStatusAdTime > 2000) {
|
while(!showingStatusAd /*|| new Date().getTime() - showStatusAdTime > 2000*/) {
|
||||||
showingStatusAd =true;
|
showingStatusAd =true;
|
||||||
showStatusAdTime = new Date().getTime();
|
showStatusAdTime = new Date().getTime();
|
||||||
showStatusAd((int) adHeight, (int) adY);
|
// showStatusAd((int) adHeight, (int) adY);
|
||||||
Log.d(TAG, "loadBannerAd: AD is requested, mStatus:" +mStatus);
|
// Log.d(TAG, "loadBannerAd: draw status, AD is requested, mStatus:" +mStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStatus==Status.OPENING ) {
|
if (mStatus==Status.OPENING ) {
|
||||||
|
@ -1086,7 +1090,9 @@ private void hideSysUI(){
|
||||||
mAdY=(int)marginHeight;
|
mAdY=(int)marginHeight;
|
||||||
mAdType =AdTpye.BANNER;
|
mAdType =AdTpye.BANNER;
|
||||||
|
|
||||||
// mAd.showTopBanner(trPage.getTopBannerHeight(),(int)(marginHeight));
|
if(trPage.getBannerHeight()==0) {
|
||||||
|
mAd.showNativeBannerInLines(0,0);//hide ad container
|
||||||
|
}
|
||||||
// mAd.showNativeBannerInLines(0,0);
|
// mAd.showNativeBannerInLines(0,0);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
@ -1163,13 +1169,19 @@ private void hideSysUI(){
|
||||||
mAdY=(int) (mHeight - statusMarginBottom - trPage.getBannerHeight());
|
mAdY=(int) (mHeight - statusMarginBottom - trPage.getBannerHeight());
|
||||||
mAdHeight = trPage.getBannerHeight();
|
mAdHeight = trPage.getBannerHeight();
|
||||||
mAdType =AdTpye.BANNER;
|
mAdType =AdTpye.BANNER;
|
||||||
}else {
|
}else if(trPage.getPageNo()>1 && trPage.isLastPage() && Constants.AD_SETTING.getChapterEndBanner().isShow()) {
|
||||||
mAdY=(int)adY;
|
mAdY=(int)adY;
|
||||||
mAdHeight = (int) adHeight;
|
mAdHeight = (int) adHeight;
|
||||||
mAdType = AdTpye.CHAPTEREND;
|
mAdType = AdTpye.CHAPTEREND;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(trPage.getBannerHeight()==0 || mAdType !=AdTpye.BANNER){
|
||||||
|
mAd.showTopBanner(0, 0);//清除所有广告
|
||||||
|
}
|
||||||
|
|
||||||
// showAd((int) adHeight, (int) adY);
|
// showAd((int) adHeight, (int) adY);
|
||||||
Log.d(TAG, String.format("loadBannerAd: AD is requested, adtype %s, adHeight %s",mAdType,adHeight));
|
Log.d(TAG, String.format("loadBannerAd: AD is requested, adtype %s, adHeight %s, ady %s",mAdType,adHeight,adY));
|
||||||
}
|
}
|
||||||
// Log.d(TAG,String.format("ad + statusMarginBottom %s ",200+ statusMarginBottom));
|
// Log.d(TAG,String.format("ad + statusMarginBottom %s ",200+ statusMarginBottom));
|
||||||
// Log.d(TAG,String.format("adHeight %s, adY %s",adHeight,adY));
|
// Log.d(TAG,String.format("adHeight %s, adY %s",adHeight,adY));
|
||||||
|
@ -1259,26 +1271,31 @@ private void hideSysUI(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showAd(){
|
public void showAd(){
|
||||||
if(mStatus == Status.LASTPAGE){
|
if(mStatus == Status.LASTPAGE || mAd==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.d(TAG, String.format("loadBannerAd showAd: mAdType %s",mAdType));
|
Log.d(TAG, String.format("loadBannerAd showAd: mAdType %s, pageNo %s",mAdType, currentPage.getPageNo()));
|
||||||
if(mAdType ==AdTpye.BANNER){
|
if(mAdType ==AdTpye.BANNER){
|
||||||
mAd.showTopBanner(mAdHeight,mAdY);
|
mAd.showTopBanner(mAdHeight,mAdY);
|
||||||
}else if(mAdType == AdTpye.NATIVEINLINES){
|
}else if(mAdType == AdTpye.NATIVEINLINES){
|
||||||
|
// mAd.showNativeBannerInLines(0,0);
|
||||||
mAd.showNativeBannerInLines(mAdHeight,mAdY);
|
mAd.showNativeBannerInLines(mAdHeight,mAdY);
|
||||||
}else if(mAdType == AdTpye.CHAPTEREND){
|
}else if(mAdType == AdTpye.CHAPTEREND){
|
||||||
|
// mAd.showNativeBannerInLines(0,0);
|
||||||
mAd.showNativeBannerInLines(mAdHeight,mAdY);
|
mAd.showNativeBannerInLines(mAdHeight,mAdY);
|
||||||
|
}else{
|
||||||
|
mAd.showNativeBannerInLines(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void showStatusAd(int adHeight,int adY) {
|
private void showStatusAd(int adHeight,int adY) {
|
||||||
|
|
||||||
boolean showAd = showingStatusAd || getCurrentPage()==null || getCurrentPage().getPageNo() > 1;
|
boolean showAd = showingStatusAd /*|| getCurrentPage()==null || getCurrentPage().getPageNo() > 1*/;
|
||||||
|
//Log.d(TAG, String.format("loadBannerAd showStatusAd: mAdType %s",mAdType));
|
||||||
// boolean showAd =true;
|
// boolean showAd =true;
|
||||||
if (showAd && mAd != null) {
|
if (showAd && mAd != null) {
|
||||||
mAd.showStatusAd(adHeight, adY);
|
// mAd.showStatusAd(adHeight, adY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1526,6 +1543,7 @@ private void hideSysUI(){
|
||||||
// currentPage = getPageForBegin(begin);
|
// currentPage = getPageForBegin(begin);
|
||||||
if (mBookPageWidget != null) {
|
if (mBookPageWidget != null) {
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
|
showAd();
|
||||||
}
|
}
|
||||||
// Log.d(TAG, String.format("prepare book set PageFactory.mStatus %s .",PageFactory.Status.FINISH ) );
|
// Log.d(TAG, String.format("prepare book set PageFactory.mStatus %s .",PageFactory.Status.FINISH ) );
|
||||||
// PageFactory.mStatus = PageFactory.Status.FINISH;
|
// PageFactory.mStatus = PageFactory.Status.FINISH;
|
||||||
|
@ -1969,6 +1987,9 @@ private void hideSysUI(){
|
||||||
currentPage = getPageForBegin(position);
|
currentPage = getPageForBegin(position);
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
hideSysUI();
|
hideSysUI();
|
||||||
|
if(position>0){
|
||||||
|
showAd();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public void retryChapt(int chapNum){
|
public void retryChapt(int chapNum){
|
||||||
|
@ -1998,6 +2019,7 @@ private void hideSysUI(){
|
||||||
currentChaptPages = loadCurrentChapt(currentChapter );
|
currentChaptPages = loadCurrentChapt(currentChapter );
|
||||||
currentPage = getPageForBegin(currentPage.getBegin());
|
currentPage = getPageForBegin(currentPage.getBegin());
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
|
showAd();
|
||||||
|
|
||||||
}
|
}
|
||||||
//改变字体大小
|
//改变字体大小
|
||||||
|
@ -2010,6 +2032,7 @@ private void hideSysUI(){
|
||||||
currentChaptPages = loadCurrentChapt(currentChapter );
|
currentChaptPages = loadCurrentChapt(currentChapter );
|
||||||
currentPage = getPageForBegin(currentPage.getBegin());
|
currentPage = getPageForBegin(currentPage.getBegin());
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
|
showAd();
|
||||||
}
|
}
|
||||||
|
|
||||||
//改变字体
|
//改变字体
|
||||||
|
|
|
@ -207,12 +207,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<FrameLayout
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:layout_marginBottom="1dp"
|
|
||||||
style="@style/frmBannerContainer"
|
|
||||||
android:layout_height="@dimen/nativeBannerHeight"
|
|
||||||
android:id="@+id/banner_container"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -291,7 +286,12 @@
|
||||||
android:nestedScrollingEnabled="false"
|
android:nestedScrollingEnabled="false"
|
||||||
android:paddingBottom="2dp"
|
android:paddingBottom="2dp"
|
||||||
/>
|
/>
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:layout_marginBottom="1dp"
|
||||||
|
style="@style/frmBannerContainer"
|
||||||
|
android:layout_height="@dimen/nativeBannerHeight"
|
||||||
|
android:id="@+id/banner_container"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout style="@style/llGraySplit" />
|
<LinearLayout style="@style/llGraySplit" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/express_ad_container"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
|
@ -2,7 +2,7 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="@color/white"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_choose_all"
|
android:id="@+id/btn_choose_all"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_delete"
|
android:id="@+id/btn_delete"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
|
@ -30,6 +32,7 @@
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_add_file"
|
android:id="@+id/btn_add_file"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal|bottom"
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
android:layout_marginBottom="160dp"
|
android:layout_marginBottom="230dp"
|
||||||
android:text="@string/refresh"
|
android:text="@string/refresh"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
<!-- <LinearLayout
|
<!-- <LinearLayout
|
||||||
|
@ -99,13 +99,15 @@
|
||||||
style="@style/frmBannerContainer"
|
style="@style/frmBannerContainer"
|
||||||
android:layout_height="@dimen/nativeBannerHeight"
|
android:layout_height="@dimen/nativeBannerHeight"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
/> <FrameLayout
|
/> -->
|
||||||
android:id="@+id/top_banner_container"
|
<FrameLayout
|
||||||
style="@style/frmBannerContainer"
|
android:id="@+id/top_banner_container"
|
||||||
android:layout_height="@dimen/topBannerHeight"
|
style="@style/frmBannerContainer"
|
||||||
|
android:layout_height="@dimen/topBannerHeight"
|
||||||
|
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
/>-->
|
|
||||||
|
/>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/banner_container"
|
android:id="@+id/banner_container"
|
||||||
style="@style/frmBannerContainer"
|
style="@style/frmBannerContainer"
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<dimen name="_20dp">20dp</dimen>
|
<dimen name="_20dp">20dp</dimen>
|
||||||
<dimen name="nativeBannerHeight">280dp</dimen>
|
<dimen name="nativeBannerHeight">280dp</dimen>
|
||||||
<dimen name="one_dp">1dp</dimen>
|
<dimen name="one_dp">1dp</dimen>
|
||||||
<dimen name="topBannerHeight">60dp</dimen>
|
<dimen name="topBannerHeight">55dp</dimen>
|
||||||
|
|
||||||
|
|
||||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">网书助手</string>
|
<string name="app_name">网书助手(测试)</string>
|
||||||
<string name="title_home">书架</string>
|
<string name="title_home">书架</string>
|
||||||
<string name="title_dashboard">书城</string>
|
<string name="title_dashboard">书城</string>
|
||||||
<string name="title_notifications">排行榜</string>
|
<string name="title_notifications">排行榜</string>
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
<string name="readseting">设置</string>
|
<string name="readseting">设置</string>
|
||||||
|
|
||||||
<string name="aboutContent">如风小说阅读是专注于提供更舒适的阅读体验,主打本地阅读,操作方式简单易上手,目前支持txt格式。</string>
|
<string name="aboutContent">如风小说阅读是专注于提供更舒适的阅读体验,主打本地阅读,操作方式简单易上手,目前支持txt格式。</string>
|
||||||
<string name="noRecord">没有数据</string>
|
<string name="noRecord">还没有记录</string>
|
||||||
<string name="title_Activity_ChgSource">换源</string>
|
<string name="title_Activity_ChgSource">换源</string>
|
||||||
<string name="_00_00">00.00%</string>
|
<string name="_00_00">00.00%</string>
|
||||||
<string name="cached">已缓存</string>
|
<string name="cached">已缓存</string>
|
||||||
|
@ -143,48 +143,7 @@
|
||||||
<string name="ad_title">[推广]</string>
|
<string name="ad_title">[推广]</string>
|
||||||
<string name="gdtslogan">gdtslogan</string>
|
<string name="gdtslogan">gdtslogan</string>
|
||||||
<string name="click_to_skip">点击跳过</string>
|
<string name="click_to_skip">点击跳过</string>
|
||||||
|
<string name="noCache">没有缓存</string>
|
||||||
|
|
||||||
<string-array name="voicer_cloud_entries">
|
|
||||||
<item>小燕—女青、中英、普通话</item>
|
|
||||||
<item>小艾—女青、中英、普通话、支持情感</item>
|
|
||||||
<item>小宇—男青、中英、普通话</item>
|
|
||||||
<item>凯瑟琳—女青、英</item>
|
|
||||||
<item>亨利—男青、英</item>
|
|
||||||
<item>玛丽—女青、英</item>
|
|
||||||
<item>小研—女青、中英、普通话</item>
|
|
||||||
<item>小琪—女青、中英、普通话</item>
|
|
||||||
<item>小峰—男青、中英、普通话</item>
|
|
||||||
<item>小梅—女青、中英、粤语</item>
|
|
||||||
<item>小莉—女青、中英、台湾普通话</item>
|
|
||||||
<item>小蓉—女青、中、四川话</item>
|
|
||||||
<item>小芸—女青、中、东北话</item>
|
|
||||||
<item>小坤—男青、中、河南话</item>
|
|
||||||
<item>小强—男青、中、湖南话</item>
|
|
||||||
<item>小莹—女青、中、陕西话</item>
|
|
||||||
<item>小新—男童、中、普通话</item>
|
|
||||||
<item>楠楠—女童、中、普通话</item>
|
|
||||||
<item>老孙—男老、中、普通话</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="voicer_cloud_values">
|
|
||||||
<item>xiaoyan</item>
|
|
||||||
<item>aisxa</item>
|
|
||||||
<item>xiaoyu</item>
|
|
||||||
<item>catherine</item>
|
|
||||||
<item>henry</item>
|
|
||||||
<item>vimary</item>
|
|
||||||
<item>vixy</item>
|
|
||||||
<item>xiaoqi</item>
|
|
||||||
<item>vixf</item>
|
|
||||||
<item>xiaomei</item>
|
|
||||||
<item>xiaolin</item>
|
|
||||||
<item>xiaorong</item>
|
|
||||||
<item>xiaoqian</item>
|
|
||||||
<item>xiaokun</item>
|
|
||||||
<item>xiaoqiang</item>
|
|
||||||
<item>vixying</item>
|
|
||||||
<item>xiaoxin</item>
|
|
||||||
<item>nannan</item>
|
|
||||||
<item>vils</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.deiniu.zhuike;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -104,14 +104,19 @@
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_aapt_derived_proguard_rules" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_aapt_derived_proguard_rules" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_main_dex_list" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged-not-compiled-resources" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/metadata_feature_manifest" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/metadata_feature_manifest" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-files" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res_stripped" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
|
||||||
|
@ -121,6 +126,7 @@
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
|
||||||
|
|
Loading…
Reference in New Issue