use of com.newsrob.util.GoogleAdsUtil in project newsrob by marianokamp.
the class AbstractNewsRobListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
getEntryManager();
boolean isHwAccelerationEnabled = EntryManager.getInstance(this).isHardwareAccelerationListsEnabled();
PL.log("User set hw accel to enabled=" + isHwAccelerationEnabled + " (activity: " + this + ").", this);
if (isHwAccelerationEnabled)
SDK11Helper.enableHWAccelerationForActivity(this);
setTheme(getEntryManager().getCurrentThemeResourceId());
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
requestWindowFeature(Window.FEATURE_NO_TITLE);
googleAdsUtil = new GoogleAdsUtil(entryManager);
/*
* WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
* lp.copyFrom(getWindow().getAttributes()); lp.format =
* PixelFormat.RGBA_8888; getWindow().setAttributes(lp);
*/
// setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
super.onCreate(savedInstanceState);
/*
* if ("com.newsrob.VIEW".equals(getIntent().getAction())) { Intent i =
* new Intent(this, ShowArticleActivity.class); i.putExtra("atomId",
* getIntent().getDataString()); startActivity(i); finish(); } else {
*/
refreshUIRunnable = new Runnable() {
public void run() {
refreshUI();
}
};
getEntryManager().updateLastUsed();
if (NewsRob.isDebuggingEnabled(this))
PL.log("onCreate called on " + getClass().getSimpleName(), this);
}
use of com.newsrob.util.GoogleAdsUtil in project newsrob by marianokamp.
the class ShowArticleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ("1".equals(NewsRob.getDebugProperties(this).getProperty("traceArticleDetailViewLaunch", "0")))
Debug.startMethodTracing("traceArticleDetialViewLaunch");
boolean isHwAccelerationEnabled = EntryManager.getInstance(this).isHardwareAccelerationAdvEnabled();
PL.log("User set hw accel to enabled=" + isHwAccelerationEnabled + " (activity: " + this + ").", this);
if (isHwAccelerationEnabled && !getEntryManager().isLightColorSchemeSelected()) {
PL.log("HW accel still disabled because of dark theme.", this);
isHwAccelerationEnabled = false;
}
if (isHwAccelerationEnabled)
SDK11Helper.enableHWAccelerationForActivity(this);
setTheme(getEntryManager().getCurrentThemeResourceId());
// setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
// gui
debug = "1".equals(NewsRob.getDebugProperties(this).getProperty("_articleDetailViewVerbose", "0"));
savedContentCursorPosition = -1;
requestWindowFeature(Window.FEATURE_NO_TITLE);
if (getIntent().getExtras() == null) {
finish();
return;
}
setContentView(com.newsrob.R.layout.show_article);
googleAdsUtil = new GoogleAdsUtil(getEntryManager());
uiHelper = new UIHelper(getEntryManager());
RelativeLayout container = getContainer();
registerForContextMenu(container);
container.setOnClickListener(this);
container.setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
lastLongClickTarget = v;
return false;
}
});
embeddedWebClient = new EmbeddedWebViewClient();
createWebView(container);
createOnScreenControls(container);
// end-gui
// runnables
refreshUIRunnable = new Runnable() {
public void run() {
refreshUI();
}
};
hideTitlePreviewRunnable = new Runnable() {
public void run() {
hideTitlePreview();
}
};
titlePreviewContainer = findViewById(R.id.title_preview);
hideAnimation = new ScaleAnimation(1f, 0f, 1f, 0f, Animation.RELATIVE_TO_PARENT, 0.5f, Animation.RELATIVE_TO_PARENT, 0.5f);
hideAnimation.setDuration(300);
hideAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
titlePreviewContainer.setVisibility(View.INVISIBLE);
}
});
showAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_PARENT, 0.5f, Animation.RELATIVE_TO_PARENT, 0.5f);
showAnimation.setDuration(300);
showAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
titlePreviewContainer.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
});
// end-runnables
initialize(getIntent());
}
Aggregations