|
@ -21,6 +21,7 @@ import android.view.LayoutInflater; |
|
|
import android.view.MotionEvent; |
|
|
import android.view.MotionEvent; |
|
|
import android.view.View; |
|
|
import android.view.View; |
|
|
import android.webkit.WebResourceRequest; |
|
|
import android.webkit.WebResourceRequest; |
|
|
|
|
|
import android.webkit.WebSettings; |
|
|
import android.webkit.WebView; |
|
|
import android.webkit.WebView; |
|
|
import android.webkit.WebViewClient; |
|
|
import android.webkit.WebViewClient; |
|
|
import android.widget.FrameLayout; |
|
|
import android.widget.FrameLayout; |
|
@ -44,6 +45,7 @@ import javax.net.ssl.SSLHandshakeException; |
|
|
|
|
|
|
|
|
import gr.thmmy.mthmmy.R; |
|
|
import gr.thmmy.mthmmy.R; |
|
|
import gr.thmmy.mthmmy.activities.BaseActivity; |
|
|
import gr.thmmy.mthmmy.activities.BaseActivity; |
|
|
|
|
|
import gr.thmmy.mthmmy.activities.LoginActivity; |
|
|
import gr.thmmy.mthmmy.data.Post; |
|
|
import gr.thmmy.mthmmy.data.Post; |
|
|
import gr.thmmy.mthmmy.utils.CircularNetworkImageView; |
|
|
import gr.thmmy.mthmmy.utils.CircularNetworkImageView; |
|
|
import gr.thmmy.mthmmy.utils.ImageController; |
|
|
import gr.thmmy.mthmmy.utils.ImageController; |
|
@ -152,17 +154,31 @@ public class TopicActivity extends BaseActivity { |
|
|
"Please sent below info to developers:\n" |
|
|
"Please sent below info to developers:\n" |
|
|
+ getLocalClassName() + "." + "l" |
|
|
+ getLocalClassName() + "." + "l" |
|
|
+ Thread.currentThread().getStackTrace()[1].getLineNumber()) |
|
|
+ Thread.currentThread().getStackTrace()[1].getLineNumber()) |
|
|
.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { |
|
|
.setNeutralButton("Dismiss", new DialogInterface.OnClickListener() { |
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
@Override |
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) { |
|
|
|
|
|
//Todo
|
|
|
|
|
|
//Maybe sent info back to developers?
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.setIcon(android.R.drawable.ic_dialog_alert) |
|
|
|
|
|
.show(); |
|
|
.show(); |
|
|
} else if (tmp_curr_status != LOGGED_IN) { |
|
|
} else if (tmp_curr_status != LOGGED_IN) { |
|
|
new AlertDialog.Builder(TopicActivity.this, R.style.AppTheme_Dark_Dialog) |
|
|
new AlertDialog.Builder(TopicActivity.this) |
|
|
.setTitle(" ") |
|
|
|
|
|
.setMessage("You need to be logged in to reply!") |
|
|
.setMessage("You need to be logged in to reply!") |
|
|
.setIcon(android.R.drawable.ic_secure) |
|
|
.setPositiveButton("Login", new DialogInterface.OnClickListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) { |
|
|
|
|
|
Intent intent = new Intent(TopicActivity.this, LoginActivity.class); |
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
finish(); |
|
|
|
|
|
overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) { |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
.show(); |
|
|
.show(); |
|
|
} else { |
|
|
} else { |
|
|
//TODO
|
|
|
//TODO
|
|
@ -450,7 +466,20 @@ public class TopicActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
//Post's WebView parameters set
|
|
|
//Post's WebView parameters set
|
|
|
post.setClickable(true); |
|
|
post.setClickable(true); |
|
|
post.setWebViewClient(new LinkLauncher()); |
|
|
//post.setWebViewClient(new LinkLauncher());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
post.getSettings().setJavaScriptEnabled(true); |
|
|
|
|
|
//TODO
|
|
|
|
|
|
post.getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND); |
|
|
|
|
|
post.setWebViewClient(new WebViewClient() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Avoiding errors about layout having 0 width/height
|
|
|
//Avoiding errors about layout having 0 width/height
|
|
|
thumbnail.setMinimumWidth(1); |
|
|
thumbnail.setMinimumWidth(1); |
|
|