最近很多小伙伴都在问com.facebook.login.widget.ProfilePictureView的实例源码和facebook源代码这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还
最近很多小伙伴都在问com.facebook.login.widget.ProfilePictureView的实例源码和facebook源代码这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展android – Facebook ProfilePictureView显示圆形图像、android – 使用Facebook App-scoped Id for ProfilePictureView、com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20的实例源码、com.facebook.drawee.view.GenericDraweeView的实例源码等相关知识,下面开始了哦!
本文目录一览:- com.facebook.login.widget.ProfilePictureView的实例源码(facebook源代码)
- android – Facebook ProfilePictureView显示圆形图像
- android – 使用Facebook App-scoped Id for ProfilePictureView
- com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20的实例源码
- com.facebook.drawee.view.GenericDraweeView的实例源码
com.facebook.login.widget.ProfilePictureView的实例源码(facebook源代码)
public CustomViewHolder(View itemView) { super(itemView); this.txtView = (TextView) itemView.findViewById(R.id.listText); this.txtLocate = (TextView) itemView.findViewById(R.id.listLocate); this.txtName = (TextView) itemView.findViewById(R.id.name); this.proFile = (ProfilePictureView) itemView.findViewById(R.id.profile_pictureFeed); this.smile = (ImageButton) itemView.findViewById(R.id.smile); this.sad = (ImageButton) itemView.findViewById(R.id.sad); this.comment = (ImageButton) itemView.findViewById(R.id.commentbtn); this.smileCount = (TextView) itemView.findViewById(R.id.smilecount); this.sadCount = (TextView) itemView.findViewById(R.id.sadcount); this.pic = (ImageView) itemView.findViewById(R.id.imagetest); this.commentView = (RecyclerView) itemView.findViewById(R.id.recycler_viewcomment); this.proFileCom = (ProfilePictureView) itemView.findViewById(R.id.profile_picturecommentself); this.send = (Button) itemView.findViewById(R.id.commentsendbtn); this.txtComment = (EditText) itemView.findViewById(R.id.commenttext); this.rl = (RelativeLayout) itemView.findViewById(R.id.relative); this.commentCount = (TextView) itemView.findViewById(R.id.commentcount); this.setting = (ImageButton) itemView.findViewById(R.id.setting); this.time = (TextView) itemView.findViewById(R.id.time); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.addproject_layout); Intent intent = getIntent(); String name = intent.getExtras().getString("name"); String email = intent.getExtras().getString("email"); String userId = intent.getExtras().getString("userid"); profilePictureView = (ProfilePictureView) findViewById(R.id.friendProfilePicture); profilePictureView.setProfileId(userId); txtName = (TextView)findViewById(R.id.textViewName); txtName.setText(name); txtEmail = (TextView)findViewById(R.id.textViewEmail); txtEmail.setText(email); btnProject = (Button)findViewById(R.id.buttonProject); btnProject.setonClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent createIntent = new Intent(AddProject.this,CreateProject.class); startActivity(createIntent); } }); }
/** * Initialises buttons on this xml with their respective elements. Updates facebook profile if * changed because the Profile is loaded asynchronously so it returns null right after log in. */ private void initComponents() { playButton = (Button) findViewById(R.id.playButton); solveButton = (Button) findViewById(R.id.solveButton); logoutButton = (Button) findViewById(R.id.log_out_button); welcomeView = (TextView) findViewById(R.id.user_name); profilePictureView = (ProfilePictureView) findViewById(R.id.profile_picture); // Checks if the profile is changed and hence current profile is null. If so updates the profile if (Profile.getCurrentProfile() != null) { welcomeView.setText(WELCOME_TAG + Profile.getCurrentProfile().getName()); profilePictureView.setProfileId(Profile.getCurrentProfile().getId()); } else { ProfileTracker profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile,Profile currentProfile) { this.stopTracking(); Profile.setCurrentProfile(currentProfile); profilePictureView.setProfileId(currentProfile.getId()); welcomeView.setText(WELCOME_TAG + currentProfile.getName()); } }; profileTracker.startTracking(); } intentPlay = new Intent(this,PlayActivity.class); intentSolve = new Intent(this,SolveActivity.class); intentLogIn = new Intent(this,LogInActivity.class); }
@Override public View getView(int position,View convertView,ViewGroup parent) { FbPage page = getItem(position); if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_page,parent,false); } TextView tvName = (TextView) convertView.findViewById(R.id.page_name_tv); ProfilePictureView pagePicture = (ProfilePictureView) convertView.findViewById(R.id.pageItemPicture); tvName.setText(page.getName()); pagePicture.setProfileId(page.getID()); return convertView; }
@Override public View getView(int position,ViewGroup parent) { final FbUserComment comment = getItem(position); if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_user_Feed_comment,false); } //region init comment_tv = (TextView)convertView.findViewById(R.id.user_Feed_comment_mess_tv); created_tv = (TextView)convertView.findViewById(R.id.user_Feed_comment_created_tv); profilePictureView = (ProfilePictureView)convertView.findViewById(R.id.user_comment_picture); user_name = (TextView)convertView.findViewById(R.id.fb_user_name); //endregion init //region get mess,user,.. comment_tv.setText(comment.getMessage()); created_tv.setText(comment.getCreated_time()); profilePictureView.setProfileId(comment.getUser()); GraphRequest request = GraphRequest.newGraPHPathRequest( Accesstoken.getCurrentAccesstoken(),"/" + comment.getUser(),new GraphRequest.Callback() { @Override public void onCompleted(GraphResponse response) { try { user_name.setText(response.getJSONObject().getString("name")); } catch (JSONException e) { e.printstacktrace(); } } }); request.executeAsync(); //endregion get mess,.. return convertView; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_scar); // Intent i = getIntent(); // latit = i.getStringExtra("lati"); // longtit = i.getStringExtra("longti"); // System.out.println(latit + longtit); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,drawer,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); View nav_header = LayoutInflater.from(this).inflate(R.layout.nav_header_main,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); new SimpleTask().execute("http://203.151.92.179:8080/getuserprofile?id=" + MemberStatic.getFbID()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bgroup); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); jG = (Button) findViewById(R.id.joinG); cG = (Button) findViewById(R.id.createG); join(); create(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); profile = Profile.getCurrentProfile(); new SimpleTask().execute("http://203.151.92.179:8080/getuserprofile?id=" + MemberStatic.getFbID()); profileSet( profile); rs = (ImageView)findViewById(R.id.reset); reset(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_group); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); new SimpleTaskG().execute("http://203.151.92.179:8080/getgroupprofile?id=" + MemberStatic.getFbID()); // lG = (Button)findViewById(R.id.leaveG); // leave(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_leagroup); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); new SimpleTaskG().execute("http://203.151.92.179:8080/getgroupprofile?id=" + MemberStatic.getFbID()); // dG = (Button)findViewById(R.id.disbandG); // disband(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_board); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); profile = Profile.getCurrentProfile(); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); new SimpleTask().execute("http://203.151.92.179:8080/getuserprofile?id=" + MemberStatic.getFbID()); }
public CommentHolder(View itemView) { super(itemView); this.pictureView = (ProfilePictureView) itemView.findViewById(R.id.profile_picturecomment); this.txtName = (TextView) itemView.findViewById(R.id.namecomment); this.txtTime = (TextView) itemView.findViewById(R.id.time); this.txtComment = (TextView) itemView.findViewById(R.id.comment); this.setting = (ImageButton) itemView.findViewById(R.id.settingcom); }
private void updateSessionInfo() { // GraphRequest meRequest = GraphRequest.newMeRequest(Accesstoken.getCurrentAccesstoken(),new GraphRequest.GraphJSONObjectCallback() { // @Override // public void onCompleted(JSONObject object,GraphResponse response) { // // } // }); // Bundle parameters = new Bundle(); // parameters.putString(FIELDS_ParaM,"id,name,link"); // meRequest.setParameters(parameters); // meRequest.executeAsync(); Profile profile = Profile.getCurrentProfile(); if (profile != null) { findViewById(R.id.activity_facebook_information_container).setVisibility(View.VISIBLE); findViewById(R.id.activity_facebook_login_button).setVisibility(View.GONE); ProfilePictureView profilePictureView = (ProfilePictureView) findViewById(R.id.activity_facebook_profile_picture); profilePictureView.setProfileId(profile.getId()); TextView informationTextView = (TextView) findViewById(R.id.activity_facebook_information); StringBuilder infoBuilder = new StringBuilder() .append("ID: ").append(profile.getId()).append("\n\n") .append("Username: ").append(profile.getName()).append("\n\n") .append("Full name: ").append(profile.getName()).append("\n\n") .append("Composed Name: ").append( TextUtils.join(" ",new String[]{ profile.getFirstName(),profile.getMiddleName(),profile.getLastName()})) .append("\n\n"); informationTextView.setText(infoBuilder.toString()); } else { findViewById(R.id.activity_facebook_information_container).setVisibility(View.GONE); findViewById(R.id.activity_facebook_login_button).setVisibility(View.VISIBLE); } }
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.fb_page_info,container,false); Intent intent = getActivity().getIntent(); String pageId = intent.getStringExtra("pageId"); final String pageName = intent.getStringExtra("pageName"); pagePicture = (ProfilePictureView) view.findViewById(R.id.pagePicture); pageName_tv = (TextView)view.findViewById(R.id.pageName); pagePicture.setProfileId(pageId); pageName_tv.setText(pageName); pageAbout(pageId); return view; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FacebookSdk.sdkInitialize(this.getApplicationContext()); callbackManager = CallbackManager.Factory.create(); LoginManager.getInstance().registerCallback(callbackManager,new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { updateUI(); } @Override public void onCancel() { updateUI(); } @Override public void onError(FacebookException e) { updateUI(); } }); setContentView(R.layout.activity_laun); userName = (TextView) findViewById(R.id.user_name); profilePicture = (ProfilePictureView) findViewById(R.id.profile_picture); profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile profile,Profile profile1) { updateUI(); } }; mainMenu = (Button) findViewById(R.id.main_menu); mainMenu.setonClickListener(new View.OnClickListener(){ @Override public void onClick(View V){ profile = Profile.getCurrentProfile(); MemberStatic.setFbID(profile.getId()); new SimpleTask().execute("http://203.151.92.179:8080/fblogin?name="+profile.getFirstName() + "%20" + profile.getLastName() +"&fb-code="+profile.getId()); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent =getIntent(); cc = intent.getStringExtra("step"); cp1 = (ProgressBar)findViewById(R.id.progressBar); cp2 = (ProgressBar)findViewById(R.id.progressBark); cp3 = (ProgressBar)findViewById(R.id.progressBarm); count1 = (TextView) findViewById(R.id.count1); count2 = (TextView) findViewById(R.id.count2); count3 = (TextView) findViewById(R.id.count3); // Bundle extra = getIntent().getExtras(); // String faceid = extra.getString("ID"); profile = Profile.getCurrentProfile(); //new SimpleTaskL().execute("http://203.151.92.179:8080/fblogin?name=" + profile.getName() + "&fb-code=" + profile.getId()); new SimpleTask().execute("http://203.151.92.179:8080/getuserprofile?id=" + MemberStatic.getFbID()); //while(user.getStepCount() == 0 ); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this,null); ((TextView)nav_header.findViewById(R.id.data_ffffffname)).setText(profile.getName()); ((ProfilePictureView)nav_header.findViewById(R.id.profile_picture)).setProfileId(profile.getId()); navigationView.addHeaderView(nav_header); sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); //count.setText(String.valueOf(user.getStepCount())); }
/** * Metodo llamado cuando la actividad es creada * @param savedInstanceState Estado anterior de la actividad guardado */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Establece la interfaz de usuario para esta Activity setContentView(R.layout.activity_pantalla_perfil); //Creamos el typeface para asignar la fuente a los textviews de la actividad Typeface fuente = Typeface.createFromAsset(getAssets(),"font/Square.ttf"); //Asignamos las distintas variables a los elementos de la interfaz de usuario foto = (ProfilePictureView)findViewById(R.id.fotoperfil); nombre = (TextView) findViewById(R.id.nombre); nivel = (TextView)findViewById(R.id.nivel); mejorJugada = (TextView)findViewById(R.id.mejorpuntuacion); partidas = (TextView)findViewById(R.id.partidas); victorias = (TextView)findViewById(R.id.partidas_ganadas); fecha_registro = (TextView) findViewById(R.id.fecha_registro); fecha_ultima = (TextView)findViewById(R.id.fecha_ultima); reto1partida = (TableRow)findViewById(R.id.reto1partida); retoultimapartida = (TableRow)findViewById(R.id.retoultimajugada); reto1jugada = (TableRow)findViewById(R.id.reto1jugada); reto1minuto = (TableRow)findViewById(R.id.reto1minuto); retoamateur = (TableRow)findViewById(R.id.retoamateur); retoprofesioal = (TableRow)findViewById(R.id.retoprofesional); retoexperto = (TableRow)findViewById(R.id.retoexperto); //Cambiamos la fuente de los elementos de la interfaz de usuario nivel.setTypeface(fuente); mejorJugada.setTypeface(fuente); partidas.setTypeface(fuente); victorias.setTypeface(fuente); fecha_registro.setTypeface(fuente); fecha_ultima.setTypeface(fuente); //Inicializamos la base de datos BD = new BDPerfilJugador(this); //Obtenemos todos los datos del perfil de la base de datos obtenerDatosPerfil(BD); //Obtenemos los datos referentes a Facebook ObtenerDatosFacebook(); }
android – Facebook ProfilePictureView显示圆形图像
我正在使用新的Facebook SDK 4.0,我想在我的应用程序中显示用户个人资料图片.
为此,我使用facebook提供的ProfilePictureView.
在我的xml我使用下面的代码 –
<com.facebook.widget.ProfilePictureView
android:id="@+id/user_profile_pic"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
facebook:preset_size="small" />
和我的活动中的代码是 –
ProfilePictureView profilePicture = (ProfilePictureView) view.findViewById(R.id.profilePicture);
profilePicture.setProfileId(userID);
我没有得到任何方式如何以循环方式显示图像.
提前致谢.
解决方法:
我相信你需要修改ProfilePictureView类.
请在下面查看SO LINK.我希望它能帮到你.
> Display FB profile pic in circular image view in Application
android – 使用Facebook App-scoped Id for ProfilePictureView
我正在为Android应用程序实现facebook的SDK.我有一个要填充的ProfilePictureView:
profilePictureView.setProfileId(id)
昨天,如果我使用了配置文件的App-scoped Id(由Graph API返回的那个),它可以工作:这是我拥有的唯一ID,因为显然是违反Facebook政策以获得“真实”ID.
但今天,没有任何修改,它返回一个空图像.我猜他们改变了后端,但如果是这样的话,ProfilePictureView的目的是什么,如果它需要一个反对Facebook的政策的ID?
解决方法:
从2018年3月26日起,所有与手动链接相关的解决方案都不再起作用
请使用以下代码
private static String FACEBOOK_FIELD_PROFILE_IMAGE = "picture.type(large)";
private static String FACEBOOK_FIELDS = "fields";
private void getFacebookData() {
GraphRequest request = GraphRequest.newMeRequest(
Accesstoken.getCurrentAccesstoken(),
(object, response) -> {
updateAvatar(getimageUrl(response));
});
Bundle parameters = new Bundle();
parameters.putString(FACEBOOK_FIELDS, FACEBOOK_FIELD_PROFILE_IMAGE);
request.setParameters(parameters);
request.executeAsync();
}
private static String FACEBOOK_FIELD_PICTURE = "picture";
private static String FACEBOOK_FIELD_DATA = "data";
private static String FACEBOOK_FIELD_URL = "url";
private String getimageUrl(GraphResponse response) {
String url = null;
try {
url = response.getJSONObject()
.getJSONObject(FACEBOOK_FIELD_PICTURE)
.getJSONObject(FACEBOOK_FIELD_DATA)
.getString(FACEBOOK_FIELD_URL);
} catch (Exception e) {
e.printstacktrace();
}
return url;
}
com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20的实例源码
private View createGLSurfaceView(Activity paramActivity,boolean paramBoolean,ResolutionStrategy paramResolutionStrategy) { if ((paramBoolean) && (checkGL20())) { GdxEglConfigChooser20 localGdxEglConfigChooser20 = getEglConfigChooser20(); GLSurfaceView20 localGLSurfaceView20 = new GLSurfaceView20(paramActivity,paramResolutionStrategy); if (localGdxEglConfigChooser20 != null) localGLSurfaceView20.setEGLConfigChooser(localGdxEglConfigChooser20); while (true) { localGLSurfaceView20.setRenderer(this); return localGLSurfaceView20; localGLSurfaceView20.setEGLConfigChooser(this.config.r,this.config.g,this.config.b,this.config.a,this.config.depth,this.config.stencil); } } return null; }
protected void preserveEGLContextOnPause () { int sdkVersion = android.os.Build.VERSION.SDK_INT; if ((sdkVersion >= 11 && view instanceof GLSurfaceView20) || view instanceof GLSurfaceView20API18) { try { view.getClass().getmethod("setPreserveEGLContextOnPause",boolean.class).invoke(view,true); } catch (Exception e) { Gdx.app.log(LOG_TAG,"Method GLSurfaceView.setPreserveEGLContextOnPause not found"); } } }
protected void preserveEGLContextOnPause () { int sdkVersion = android.os.Build.VERSION.SDK_INT; if ((sdkVersion >= 11 && view instanceof GLSurfaceView20) || view instanceof GLSurfaceView20API18) { try { view.getClass().getmethod("setPreserveEGLContextOnPause",true); } catch (Exception e) { Gdx.app.log(LOG_TAG,"Method GLSurfaceView.setPreserveEGLContextOnPause not found"); } } }
private void setupGL(javax.microedition.khronos.opengles.GL10 paramGL10) { if ((this.gl10 != null) || (this.gl20 != null)) return; if ((this.view instanceof GLSurfaceView20)) { this.gl20 = new AndroidGL20(); this.gl = this.gl20; } while (true) { this.glu = new Androidglu(); Gdx.gl = this.gl; Gdx.gl10 = this.gl10; Gdx.gl11 = this.gl11; Gdx.gl20 = this.gl20; Gdx.glu = this.glu; Gdx.app.log("AndroidGraphics","OGL renderer: " + paramGL10.glGetString(7937)); Gdx.app.log("AndroidGraphics","OGL vendor: " + paramGL10.glGetString(7936)); Gdx.app.log("AndroidGraphics","OGL version: " + paramGL10.glGetString(7938)); Gdx.app.log("AndroidGraphics","OGL extensions: " + paramGL10.glGetString(7939)); return; this.gl10 = new AndroidGL10(paramGL10); this.gl = this.gl10; if ((paramGL10 instanceof javax.microedition.khronos.opengles.GL11)) { String str = paramGL10.glGetString(7937); if ((str != null) && (!str.toLowerCase().contains("pixelflinger")) && (!Build.MODEL.equals("MB200")) && (!Build.MODEL.equals("MB220")) && (!Build.MODEL.contains("Behold"))) { this.gl11 = new AndroidGL11((javax.microedition.khronos.opengles.GL11)paramGL10); this.gl10 = this.gl11; } } } }
com.facebook.drawee.view.GenericDraweeView的实例源码
public void displayImageWithResizing(Uri imageUri,int width,int height,ImageView imageView) { if (!(imageView instanceof GenericDraweeView)) { throw new IllegalAccessError("please use fresco image view"); } if (imageUri == null) { return; } ImageRequest req = ImageRequestBuilder.newBuilderWithSource(imageUri) .setResizeOptions(new ResizeOptions(width,height)) .setLocalThumbnailPreviewsEnabled(true) .setProgressiveRenderingEnabled(true) .build(); GenericDraweeView v = (GenericDraweeView) imageView; DraweeController ctrl = Fresco.newDraweeControllerBuilder() .setoldController(v.getController()) .setimageRequest(req) .build(); v.setController(ctrl); }
public void displayImage(String imageUri,ImageView imageView,ImageLoadingListener listener) { if (TextUtils.isEmpty(imageUri)) return; if (imageView instanceof GenericDraweeView) { if (listener != null) { PipelineDraweeControllerBuilder builder = Fresco.newDraweeControllerBuilder(); ImageLoaderListener listener1 = new ImageLoaderListener(); listener1.setData(listener,imageUri,imageView); ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(imageUri)).build(); AbstractDraweeController controller = builder.setoldController(((GenericDraweeView) imageView).getController()).setControllerListener(listener1).setimageRequest(request).build(); ((GenericDraweeView) imageView).setController(controller); return; } } imageView.setimageURI(Uri.parse(imageUri)); }
public void displayImage(Uri imageUri,ImageView imageView) { if (!(imageView instanceof GenericDraweeView)) { throw new IllegalAccessError("please use fresco image view"); } if (imageUri == null) { return; } imageView.setimageURI(imageUri); }
public void displayImageWithGif(String url,ImageView view) { if (view != null && view instanceof GenericDraweeView && !TextUtils.isEmpty(url)) { GenericDraweeView draweeView = (GenericDraweeView) view; ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url)).build(); DraweeController controller = Fresco.newDraweeControllerBuilder() .setimageRequest(request) .setoldController(draweeView.getController()) .setAutoplayAnimations(true) .build(); draweeView.setController(controller); } }
今天的关于com.facebook.login.widget.ProfilePictureView的实例源码和facebook源代码的分享已经结束,谢谢您的关注,如果想了解更多关于android – Facebook ProfilePictureView显示圆形图像、android – 使用Facebook App-scoped Id for ProfilePictureView、com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20的实例源码、com.facebook.drawee.view.GenericDraweeView的实例源码的相关知识,请在本站进行查询。
本文标签: