本文整理汇总了Java中com.vk.sdk.api.model.VKApiUser类的典型用法代码示例。如果您正苦于以下问题:Java VKApiUser类的具体用法?Java VKApiUser怎么用?Java VKApiUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VKApiUser类属于com.vk.sdk.api.model包,在下文中一共展示了VKApiUser类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onLoadFinished
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<ArrayList<VKApiUser>> loader, ArrayList<VKApiUser> data) {
boolean success;
if(data != null && data.size() == 1){
UserPreferences.getInstance().setVKApiUser(data.get(0));
success = true;
Log.i(LOG_TAG, "user name: " + UserPreferences.getInstance().getVKApiUser().first_name);
}else {
// что-то пошло не так
success = false;
}
IUserLoaderCallback userLoaderCallback;
userLoaderCallback = (IUserLoaderCallback) getActivity();
if(userLoaderCallback != null){
userLoaderCallback.loadFinished(success);
}
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:19,代码来源:UserLoaderFragment.java
示例2: deliverResult
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
private void deliverResult(ArrayList<VKApiUser> data) {
if(data == null){
Log.i(LOG_TAG, "deliverResult data is null");
}else {
Log.i(LOG_TAG, "deliverResult data size: " + data.size());
}
if (isStarted()) {
// если стартовал, то можем отправить результат
super.deliverResult(data);
}
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:13,代码来源:UsersLoader.java
示例3: get
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
/**
* https://vk.com/dev/users.get
*
* @param params use parameters from description with VKApiConst class
* @return Request for load
*/
public VKRequest get(VKParameters params) {
return prepareRequest("get", params, VKRequest.HttpMethod.GET, new VKParser() {
@Override
public Object createModel(JSONObject object) {
return new VKList<VKApiUser>(object, VKApiUser.class);
}
});
}
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:15,代码来源:VKApiUsers.java
示例4: makeRequest
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
private void makeRequest() {
VKRequest request = new VKRequest("apps.getFriendsList", VKParameters.from("extended", 1, "type", "request"));
request.executeWithListener(new VKRequestListener() {
@Override
public void onComplete(VKResponse response) {
final Context context = getContext();
if (context == null || !isAdded()) {
return;
}
try {
JSONArray jsonArray = response.json.getJSONObject("response").getJSONArray("items");
int length = jsonArray.length();
final VKApiUser[] vkApiUsers = new VKApiUser[length];
CharSequence[] vkApiUsersNames = new CharSequence[length];
for (int i = 0; i < length; i++) {
VKApiUser user = new VKApiUser(jsonArray.getJSONObject(i));
vkApiUsers[i] = user;
vkApiUsersNames[i] = user.first_name + " " + user.last_name;
}
new AlertDialog.Builder(context)
.setTitle(R.string.send_request_title)
.setItems(vkApiUsersNames, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startApiCall(new VKRequest("apps.sendRequest",
VKParameters.from("user_id", vkApiUsers[which].id, "type", "request")));
}
}).create().show();
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:VKCOM,项目名称:vk-android-sdk,代码行数:35,代码来源:TestActivity.java
示例5: UserModule
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
public UserModule(VKApiUser user) {
this.user = user;
}
开发者ID:Mavamaarten,项目名称:vk_music_android,代码行数:4,代码来源:UserModule.java
示例6: provideApiUser
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
@Provides
@UserScope
VKApiUser provideApiUser() {
return user;
}
开发者ID:Mavamaarten,项目名称:vk_music_android,代码行数:6,代码来源:UserModule.java
示例7: createUserComponent
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
public UserComponent createUserComponent(VKApiUser user) {
userComponent = appComponent.plus(new UserModule(user));
return userComponent;
}
开发者ID:Mavamaarten,项目名称:vk_music_android,代码行数:5,代码来源:VkApplication.java
示例8: onCreateLoader
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
@Override
public Loader<ArrayList<VKApiUser>> onCreateLoader(int id, Bundle args) {
return new UsersLoader(getActivity());
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:5,代码来源:UserLoaderFragment.java
示例9: getVKApiUser
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
public VKApiUser getVKApiUser() {
return mVKApiUser;
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:4,代码来源:UserPreferences.java
示例10: setVKApiUser
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
public void setVKApiUser(VKApiUser mVKApiUser) {
this.mVKApiUser = mVKApiUser;
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:4,代码来源:UserPreferences.java
示例11: onCreateView
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view;
view = inflater.inflate(R.layout.settings_layout, container, false);
ListView listView;
listView = (ListView)view.findViewById(R.id.settings_list);
// Меню
String[] titles;
titles = new String[2];
// Оценить приложение
titles[0] = getString(R.string.rate_app);
// сменить пользователя
String str;
VKApiUser vkApiUser;
vkApiUser = UserPreferences.getInstance().getVKApiUser();
str = getString(R.string.logout);
str += "\n";
str += getString(R.string.user) + ": ";
str += vkApiUser.first_name + " " + vkApiUser.last_name;
titles[1] = str;
// версия
PackageInfo pInfo = null;
try{
pInfo = getActivity().getPackageManager().getPackageInfo(
getActivity().getPackageName(), 0);
}catch (PackageManager.NameNotFoundException e){
e.printStackTrace();
}
if(pInfo != null){
Log.i(TAG, "version: " + pInfo.versionName + ", code: " + pInfo.versionCode);
TextView textView;
textView = (TextView) view.findViewById(R.id.version_text);
textView.setText(getString(R.string.version) + ": " + pInfo.versionName);
}else {
Log.i(TAG, "version is null");
}
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(),
R.layout.settings_list_item,
titles);
listView.setAdapter(adapter);
listView.setOnItemClickListener(this);
return view;
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:55,代码来源:SettingsFragment.java
示例12: CachedUser
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
public CachedUser(VKApiUser user) {
id = user.id;
firstName = user.first_name;
lastName = user.last_name;
photo100 = user.photo_100;
}
开发者ID:yeputons,项目名称:ofeed,代码行数:7,代码来源:CachedUser.java
示例13: onLoaderReset
import com.vk.sdk.api.model.VKApiUser; //导入依赖的package包/类
@Override
public void onLoaderReset(Loader<ArrayList<VKApiUser>> loader) {
}
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:5,代码来源:UserLoaderFragment.java
注:本文中的com.vk.sdk.api.model.VKApiUser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论