当前位置: 首页>>代码示例>>Java>>正文


Java ParseQueryAdapter类代码示例

本文整理汇总了Java中com.parse.ParseQueryAdapter的典型用法代码示例。如果您正苦于以下问题:Java ParseQueryAdapter类的具体用法?Java ParseQueryAdapter怎么用?Java ParseQueryAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParseQueryAdapter类属于com.parse包,在下文中一共展示了ParseQueryAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: categorySpinnerSetup

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public void categorySpinnerSetup() {
    ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
        public ParseQuery create() {
            ParseQuery query = new ParseQuery("Category");
            return query;
        }
    };

    categoryAdapter = new ParseQueryAdapter<ParseObject>(this,
            factory);
    categoryAdapter.setTextKey("name");
    categorySpinner.setAdapter(categoryAdapter);
    categorySpinner.setSelection(1);
    categorySpinner
            .setOnItemSelectedListener(new CategorySpinnerListener());
}
 
开发者ID:BehrouzRiahu,项目名称:Marketplace,代码行数:17,代码来源:PostActivity.java

示例2: UserViewAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public UserViewAdapter(Context context) {
	super(context, new ParseQueryAdapter.QueryFactory<Photo>() {
		public ParseQuery<Photo> create() {
			
			// Get the current user's photos
			ParseQuery<Photo> photosFromCurrentUserQuery = new ParseQuery<Photo>("Photo");
			photosFromCurrentUserQuery.whereEqualTo("user", ParseUser.getCurrentUser());
			photosFromCurrentUserQuery.whereExists("thumbnail");
			
			photosFromCurrentUserQuery.include("user");
			photosFromCurrentUserQuery.orderByDescending("createdAt");
			
			return photosFromCurrentUserQuery;
		}
	});
}
 
开发者ID:salmank888,项目名称:Anypic-Android,代码行数:17,代码来源:UserViewAdapter.java

示例3: regionSpinnerSetup

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public void regionSpinnerSetup() {
    ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
        public ParseQuery create() {
            ParseQuery query = new ParseQuery("Region");
            return query;
        }
    };

    regionAdapter = new ParseQueryAdapter<ParseObject>(this,
            factory);
    regionAdapter.setTextKey("name");
    regionSpinner.setAdapter(regionAdapter);
    regionSpinner.setSelection(1);
    regionSpinner.setOnItemSelectedListener(new RegionSpinnerListener());
}
 
开发者ID:BehrouzRiahu,项目名称:Marketplace,代码行数:16,代码来源:PostActivity.java

示例4: regionSpinnerSetup

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public void regionSpinnerSetup(){
    ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
        @Override
        public ParseQuery create() {
            ParseQuery query = new ParseQuery("Region");
            return query;
        }
    };

    regionAdapter = new MyParseAdapter(getActivity(), factory);
    regionAdapter.setTextKey("name");
    regionSpinner.setAdapter(regionAdapter);
    regionSpinner.setSelection(1);
    regionSpinner.setOnItemSelectedListener(new RegionSpinnerListener());
}
 
开发者ID:BehrouzRiahu,项目名称:Marketplace,代码行数:16,代码来源:SearchFragment.java

示例5: categorySpinnerSetup

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public void categorySpinnerSetup(){
    ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
        @Override
        public ParseQuery create() {
            ParseQuery query = new ParseQuery("Category");
            return query;
        }
    };

    categoryAdapter = new MyParseAdapter(getActivity(), factory);
    categoryAdapter.setTextKey("name");
    categorySpinner.setAdapter(categoryAdapter);
    categorySpinner.setSelection(1);
    categorySpinner.setOnItemSelectedListener(new CategorySpinnerListener());
}
 
开发者ID:BehrouzRiahu,项目名称:Marketplace,代码行数:16,代码来源:SearchFragment.java

示例6: HomeViewAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public HomeViewAdapter(Context context) {
	super(context, new ParseQueryAdapter.QueryFactory<Photo>() {
		public ParseQuery<Photo> create() {
			
			// First, query for the friends whom the current user follows
			ParseQuery<com.parse.anypic.Activity> followingActivitiesQuery = new ParseQuery<com.parse.anypic.Activity>("Activity");
			followingActivitiesQuery.whereMatches("type", "follow");
			followingActivitiesQuery.whereEqualTo("fromUser", ParseUser.getCurrentUser());
			
			// Get the photos from the Users returned in the previous query
			ParseQuery<Photo> photosFromFollowedUsersQuery = new ParseQuery<Photo>("Photo");
			photosFromFollowedUsersQuery.whereMatchesKeyInQuery("user", "toUser", followingActivitiesQuery);
			photosFromFollowedUsersQuery.whereExists("image");
			
			// Get the current user's photos
			ParseQuery<Photo> photosFromCurrentUserQuery = new ParseQuery<Photo>("Photo");
			photosFromCurrentUserQuery.whereEqualTo("user", ParseUser.getCurrentUser());
			photosFromCurrentUserQuery.whereExists("image");
			
			// We create a final compound query that will find all of the photos that were
		    // taken by the user's friends or by the user
			ParseQuery<Photo> query = ParseQuery.or(Arrays.asList( photosFromFollowedUsersQuery, photosFromCurrentUserQuery ));
			query.include("user");
			query.orderByDescending("createdAt");
			
			return query;
		}
	});
}
 
开发者ID:salmank888,项目名称:Anypic-Android,代码行数:30,代码来源:HomeViewAdapter.java

示例7: DonationAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public DonationAdapter(Context context,
		ParseQueryAdapter.QueryFactory<Donation> queryFactory) {
	// Custom Query
	super(context, queryFactory);
	activity = (FragmentActivity) context;
	this.setObjectsPerPage(PAGE_SIZE);
}
 
开发者ID:rutvijkumarshah,项目名称:WatsiAndroidApp,代码行数:8,代码来源:DonationAdapter.java

示例8: PatientAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public PatientAdapter(final Context context) {
	
	// load all patients
	// if required this is the place to apply where filters on patients list
	this(context, new ParseQueryAdapter.QueryFactory<Patient>() {
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public ParseQuery create() {
			return new ParseHelper(context).getAllPatientsQuery();
		}
	});
}
 
开发者ID:rutvijkumarshah,项目名称:WatsiAndroidApp,代码行数:12,代码来源:PatientAdapter.java

示例9: HomeFeedAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public HomeFeedAdapter(Context context,ParseQueryAdapter.QueryFactory<NewsItem> queryFactory) {
	//Custom Query
	super(context,queryFactory); 
	activity = (WatsiMainActivity) context;
	this.setObjectsPerPage(PAGE_SIZE);
	
}
 
开发者ID:rutvijkumarshah,项目名称:WatsiAndroidApp,代码行数:8,代码来源:HomeFeedAdapter.java

示例10: PhotoListAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public PhotoListAdapter(Context context) {
	super(context, new ParseQueryAdapter.QueryFactory<PrsPhoto>() {
		public ParseQuery<PrsPhoto> create() {
			// Here we can configure a ParseQuery to display
			// only top-rated meals.
			ParseQuery query = new ParseQuery("PrsPhoto");
			return query;
		}
	});
}
 
开发者ID:triestpa,项目名称:PhotoShare,代码行数:11,代码来源:PhotoListAdapter.java

示例11: GoalAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public GoalAdapter(Context context) {
    super(context, new ParseQueryAdapter.QueryFactory<Goal>() {
        @Override
        public ParseQuery<Goal> create() {
            ParseQuery<Goal> query = ParseQuery.getQuery(Goal.class);
            query.whereEqualTo(Goal.USER_KEY, (User) User.getCurrentUser());
            query.addAscendingOrder(Goal.GOAL_START_DATE_KEY);
            return query;
        }
    });
}
 
开发者ID:CodePath-MAF,项目名称:AndroidClient,代码行数:12,代码来源:GoalAdapter.java

示例12: CategoryAdapter

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public CategoryAdapter(Context context) {
    super(context, new ParseQueryAdapter.QueryFactory<Category>() {

        @Override
        public ParseQuery<Category> create() {
            return new CategoryDao().getLocalQuery();
        }
    });
}
 
开发者ID:CodePath-MAF,项目名称:AndroidClient,代码行数:10,代码来源:CategoryAdapter.java

示例13: onCreate

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
/** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.lain);
		s1=(Spinner)findViewById(R.id.contact);
		spad=new ParseQueryAdapter<ParseUser>(this,ParseUser.class);
		spad.setTextKey("username");
		s1.setAdapter(spad);
		s1.setOnItemSelectedListener(this);
        b1=(Button)findViewById(R.id.b1);
        t2=(EditText)findViewById(R.id.t2);
        t3=(EditText)findViewById(R.id.title);
        
b1.setOnClickListener(new Button.OnClickListener(){

			@Override
			public void onClick(View arg0) {
				
				String text=t2.getText().toString();
				String title=t3.getText().toString();
				 newpost=new Post();
				
				    
				    newpost.setMessage(text);
				 newpost.setTitle(title);
				   newpost.setReciever(reciever);
				    newpost.setAuthor(ParseUser.getCurrentUser());
				 
				    newpost.saveInBackground(new SaveCallback() {
				 
				        @Override
				        public void done(ParseException e) {
				            if (e == null) {
				               setResult(Activity.RESULT_OK);
				                finish();
				            } else {
				                Toast.makeText(null, "Error saving: " + e.getMessage(),Toast.LENGTH_SHORT).show();
				            }
				        }
				 
				    });
				 
			}
        	
        });
		
		
		
	}
 
开发者ID:nikhil-bhat,项目名称:class_board_app,代码行数:50,代码来源:NewPostActivity.java

示例14: onCreate

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
/** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
		ParseInstallation installation = ParseInstallation.getCurrentInstallation();
		installation.put("user",ParseUser.getCurrentUser());
		installation.saveInBackground();
		super.onCreate(savedInstanceState);
		//getListView().setClickable(false);
setContentView(R.layout.main);
		
ParseQueryAdapter.QueryFactory<Post> factory =
new ParseQueryAdapter.QueryFactory<Post>() {
  public ParseQuery<Post> create() {
    
    ParseQuery<Post> query = Post.getQuery();
    query.include("author");
    query.orderByDescending("createdAt");
    query.whereEqualTo("reciever",ParseUser.getCurrentUser().getUsername());
    query.setLimit(10);
    return query;
  }
};


mainAdapter = new ParseQueryAdapter<Post>(this, factory) {
    @Override
    public View getItemView(Post post, View view, ViewGroup parent) {
      if (view == null) {
        view = View.inflate(getContext(), R.layout.post_item, null);
      }
      TextView contentView = (TextView) view.findViewById(R.id.contentView);
      TextView usernameView = (TextView) view.findViewById(R.id.usernameView);
      contentView.setText(post.getMessage());
      usernameView.setText(post.getAuthor().getUsername());
      return view;
    }
  };

  ListView postsView = (ListView) this.findViewById(R.id.listy);
  postsView.setAdapter(mainAdapter);



/*mainAdapter = new ParseQueryAdapter<Post>(this, Post.class);
		mainAdapter.setTextKey("message");
	*/	
		//setListAdapter(mainAdapter);
	}
 
开发者ID:nikhil-bhat,项目名称:class_board_app,代码行数:48,代码来源:PostListActivity.java

示例15: setList

import com.parse.ParseQueryAdapter; //导入依赖的package包/类
public void setList(ParseQueryAdapter<BuzzboxPost> Po){
	
	JazzyListView postsView = (JazzyListView) this.findViewById(R.id.postsView);
       postsView.setAdapter(Po);
       postsView.setTransitionEffect(JazzyHelper.CARDS);
}
 
开发者ID:chinmaykrishna,项目名称:Social-Networking-App-where-you-smiling-is-liking-the-post,代码行数:7,代码来源:MainActivity.java


注:本文中的com.parse.ParseQueryAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。