Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. package company.nas.fotofriend.mvp.authorization;
  2.  
  3.  
  4. import android.app.Fragment;
  5. import android.util.Log;
  6. import android.view.View;
  7. import android.webkit.WebResourceRequest;
  8. import android.webkit.WebSettings;
  9. import android.webkit.WebView;
  10.  
  11. import company.nas.fotofriend.R;
  12. import company.nas.fotofriend.VkWebViewClient;
  13. import company.nas.fotofriend.mvp.base.Basefragment;
  14.  
  15.  
  16. /**
  17. * A simple {@link Fragment} subclass.
  18. */
  19. public class AuthFragment extends Basefragment {
  20. WebView wvAuth;
  21.  
  22. @Override
  23. protected void onCreateView(View view) {
  24. wvAuth = view.findViewById(R.id.wv_auth);
  25. initWV();
  26. }
  27.  
  28. @Override
  29. protected int getResourceID() {
  30. return R.layout.fragment_auth;
  31. }
  32.  
  33.  
  34.  
  35. private void initWV() {
  36. WebSettings webSettings = wvAuth.getSettings();
  37. webSettings.setJavaScriptEnabled(true);
  38. wvAuth.setHorizontalScrollBarEnabled(false);
  39. webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
  40.  
  41. wvAuth.setWebViewClient(new VkWebViewClient());
  42. wvAuth.loadUrl("https://oauth.vk.com/authorize?client_id=6287930&scope=friends,notify,photos,photos,audio,video,docs,notes,pages,groups,offline&redirect_uri=https://oauth.vk.com/blank.html&display=mobile&v=5.5&response_type=token&revoke=1");
  43.  
  44.  
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement