• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SessionDetailQueryEnum类的典型用法和代码示例

java 2次浏览

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

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

示例1: requestData

点赞 3

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public void requestData(@NonNull SessionDetailQueryEnum query,
        @NonNull DataQueryCallback<SessionDetailQueryEnum> callback) {
    switch (query) {
        case RESERVATION_PENDING:
        case RESERVATION_STATUS:
        case RESERVATION_RESULT:
        case RESERVATION_FAILED:
        case RESERVATION_SEAT_AVAILABILITY:
            mDataQueryCallbacks.put(query, callback);
            break;
        default:
            super.requestData(query, callback);
            break;
    }
}
 

开发者ID:google,
项目名称:iosched,
代码行数:17,
代码来源:SessionDetailModel.java

示例2: displayData

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public void displayData(SessionDetailModel data, QueryEnum query) {
    if (SessionDetailQueryEnum.SESSIONS == query) {
        displaySessionData(data);
    } else if (SessionDetailQueryEnum.FEEDBACK == query) {
        displayFeedbackData(data);
    } else if (SessionDetailQueryEnum.SPEAKERS == query) {
        displaySpeakersData(data);
    } else if (SessionDetailQueryEnum.TAG_METADATA == query) {
        displayTags(data);
    }
}
 

开发者ID:dreaminglion,
项目名称:iosched-reader,
代码行数:13,
代码来源:SessionDetailFragment.java

示例3: getDataUri

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public Uri getDataUri(QueryEnum query) {
    if (SessionDetailQueryEnum.SESSIONS == query) {
        return ((SessionDetailActivity) getActivity()).getSessionUri();
    } else {
        return null;
    }
}
 

开发者ID:dreaminglion,
项目名称:iosched-reader,
代码行数:9,
代码来源:SessionDetailFragment.java

示例4: onActivityCreated

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mHandler = new Handler();

    // init presenter
    SessionDetailModel model = ModelProvider.provideSessionDetailModel(
            ((SessionDetailActivity) getActivity()).getSessionUri(), getContext(),
            new SessionsHelper(getActivity()), getLoaderManager());
    mPresenter =
            new SessionDetailPresenter(model, this, SessionDetailUserActionEnum.values(),
                    SessionDetailQueryEnum.values());
    mPresenter.loadInitialQueries();
}
 

开发者ID:google,
项目名称:iosched,
代码行数:15,
代码来源:SessionDetailFragment.java

示例5: getDataUri

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public Uri getDataUri(SessionDetailQueryEnum query) {
    switch (query) {
        case SESSIONS:
            return ((SessionDetailActivity) getActivity()).getSessionUri();
        default:
            return null;
    }
}
 

开发者ID:google,
项目名称:iosched,
代码行数:10,
代码来源:SessionDetailFragment.java

示例6: SessionDetailModel

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
public SessionDetailModel(Uri sessionUri, Context context, SessionsHelper sessionsHelper,
        LoaderManager loaderManager) {
    super(SessionDetailQueryEnum.values(), SessionDetailUserActionEnum.values(), loaderManager);
    mContext = context;
    mSessionsHelper = sessionsHelper;
    mSessionUri = sessionUri;
    mSessionId = extractSessionId(sessionUri);
}
 

开发者ID:google,
项目名称:iosched,
代码行数:9,
代码来源:SessionDetailModel.java

示例7: readDataFromCursor

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public boolean readDataFromCursor(Cursor cursor, SessionDetailQueryEnum query) {
    boolean success = false;

    if (cursor != null && cursor.moveToFirst()) {

        if (SessionDetailQueryEnum.SESSIONS == query) {
            readDataFromSessionCursor(cursor);
            mSessionLoaded = true;
            success = true;
        } else if (SessionDetailQueryEnum.TAG_METADATA == query) {
            readDataFromTagMetadataCursor(cursor);
            success = true;
        } else if (SessionDetailQueryEnum.FEEDBACK == query) {
            readDataFromFeedbackCursor(cursor);
            success = true;
        } else if (SessionDetailQueryEnum.SPEAKERS == query) {
            readDataFromSpeakersCursor(cursor);
            success = true;
        } else if (SessionDetailQueryEnum.MY_VIEWED_VIDEOS == query) {
            readDataFromMyViewedVideosCursor(cursor);
            success = true;
        } else if (SessionDetailQueryEnum.RELATED == query) {
            readDataFromRelatedSessionsCursor(cursor);
            success = true;
        }
    }

    return success;
}
 

开发者ID:google,
项目名称:iosched,
代码行数:31,
代码来源:SessionDetailModel.java

示例8: createCursorLoader

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public Loader<Cursor> createCursorLoader(SessionDetailQueryEnum query, Bundle args) {
    CursorLoader loader = null;
    if (query == null) {
        return loader;
    }
    switch (query) {
        case SESSIONS:
            loader = getCursorLoaderInstance(mContext, mSessionUri,
                    SessionDetailQueryEnum.SESSIONS.getProjection(), null, null, null);
            break;
        case SPEAKERS:
            Uri speakersUri = getSpeakersDirUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, speakersUri,
                    SessionDetailQueryEnum.SPEAKERS.getProjection(), null, null,
                    ScheduleContract.Speakers.DEFAULT_SORT);
            break;
        case FEEDBACK:
            Uri feedbackUri = getFeedbackUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, feedbackUri,
                    SessionDetailQueryEnum.FEEDBACK.getProjection(), null, null, null);
            break;
        case TAG_METADATA:
            loader = getTagMetadataLoader();
            break;
        case MY_VIEWED_VIDEOS:
            Uri myPlayedVideoUri = ScheduleContract.MyViewedVideos.buildMyViewedVideosUri(
                    AccountUtils.getActiveAccountName(mContext));
            loader = getCursorLoaderInstance(mContext, myPlayedVideoUri,
                    SessionDetailQueryEnum.MY_VIEWED_VIDEOS.getProjection(), null, null, null);
            break;
        case RELATED:
            Uri relatedSessionsUri = Sessions.buildRelatedSessionsDirUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, relatedSessionsUri,
                    SessionDetailQueryEnum.RELATED.getProjection(), null, null, null);
            break;
    }
    return loader;
}
 

开发者ID:google,
项目名称:iosched,
代码行数:40,
代码来源:SessionDetailModel.java

示例9: attemptReserve

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
public void attemptReserve() {
    FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();
    if (mQueueReference != null && currentUser != null) {
        final String requestId = generateReserveRequestId();
        QueueAction queueAction = new QueueAction(mSessionId, "reserve", requestId);
        mQueueReference.addValueEventListener(mQueueEventListener);
        mQueueReference.setValue(queueAction).addOnCompleteListener(
                new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        LOGD(TAG, "Enter queue.");
                        mReservationPending = true;
                        mReturnPending = false;
                        DataQueryCallback<SessionDetailQueryEnum> reservationPendingCallback
                                = mDataQueryCallbacks.get(RESERVATION_PENDING);
                        reservationPendingCallback.onModelUpdated(
                                SessionDetailModel.this, RESERVATION_PENDING);
                        mSessionReservationResultReference
                                .child(requestId)
                                .addValueEventListener(mSessionReservationResultEventListener);
                    }
                }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                LOGE(TAG, e.getMessage());
                mReservationPending = false;
                mReturnPending = false;
                DataQueryCallback<SessionDetailQueryEnum> reservationFailedCallback
                        = mDataQueryCallbacks.get(RESERVATION_FAILED);
                reservationFailedCallback
                        .onModelUpdated(SessionDetailModel.this, RESERVATION_FAILED);
            }
        });
    }
}
 

开发者ID:google,
项目名称:iosched,
代码行数:36,
代码来源:SessionDetailModel.java

示例10: attemptReturnReservation

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
public void attemptReturnReservation() {
    FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();
    if (mQueueReference != null && currentUser != null) {
        final String requestId = generateReserveRequestId();
        QueueAction queueAction = new QueueAction(mSessionId, "return", requestId);
        mQueueReference.addValueEventListener(mQueueEventListener);
        mQueueReference.setValue(queueAction).addOnCompleteListener(
                new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        LOGD(TAG, "Enter queue.");
                        mReservationPending = false;
                        mReturnPending = true;
                        DataQueryCallback<SessionDetailQueryEnum> reservationPendingCallback
                                = mDataQueryCallbacks.get(RESERVATION_PENDING);
                        reservationPendingCallback.onModelUpdated(
                                SessionDetailModel.this, RESERVATION_PENDING);
                        mSessionReservationResultReference
                                .child(requestId)
                                .addValueEventListener(mSessionReservationResultEventListener);
                    }
                }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                LOGE(TAG, e.getMessage());
                mReservationPending = false;
                mReturnPending = false;
                DataQueryCallback<SessionDetailQueryEnum> reservationFailedCallback
                        = mDataQueryCallbacks.get(RESERVATION_FAILED);
                reservationFailedCallback
                        .onModelUpdated(SessionDetailModel.this, RESERVATION_FAILED);
            }
        });
    }
}
 

开发者ID:google,
项目名称:iosched,
代码行数:36,
代码来源:SessionDetailModel.java

示例11: onCreate

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    UIUtils.tryTranslateHttpIntent(this);
    BeamUtils.tryUpdateIntentFromBeam(this);
    boolean shouldBeFloatingWindow = shouldBeFloatingWindow();
    if (shouldBeFloatingWindow) {
        setupFloatingWindow(R.dimen.session_details_floating_width,
                R.dimen.session_details_floating_height, 1, 0.4f);
    }

    super.onCreate(savedInstanceState);
    setContentView(R.layout.session_detail_act);

    final Toolbar toolbar = getActionBarToolbar();
    toolbar.setNavigationIcon(shouldBeFloatingWindow
            ? R.drawable.ic_ab_close : R.drawable.ic_up);
    toolbar.setNavigationContentDescription(R.string.close_and_go_back);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish();
        }
    });
    mHandler.post(new Runnable() {
        @Override
        public void run() {
            // Do not display the Activity name in the toolbar
            toolbar.setTitle("");
        }
    });

    if (savedInstanceState == null) {
        Uri sessionUri = getIntent().getData();
        BeamUtils.setBeamSessionUri(this, sessionUri);
    }

    mSessionUri = getIntent().getData();

    if (mSessionUri == null) {
        LOGE(TAG, "SessionDetailActivity started with null session Uri!");
        finish();
        return;
    }

    addPresenterFragment(R.id.session_detail_frag,
            new SessionDetailModel(mSessionUri, getApplicationContext(),
                    new SessionsHelper(this)), SessionDetailQueryEnum.values(),
            SessionDetailUserActionEnum.values());
}
 

开发者ID:dreaminglion,
项目名称:iosched-reader,
代码行数:50,
代码来源:SessionDetailActivity.java

示例12: displayData

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public void displayData(SessionDetailModel data, SessionDetailQueryEnum query) {
    switch (query) {
        case SESSIONS:
            displaySessionData(data);
            displayTrackColor(data);
            break;
        case FEEDBACK:
            updateFeedbackButton(data);
            break;
        case SPEAKERS:
            displaySpeakersData(data);
            break;
        case TAG_METADATA:
            displayTags(data);
            displayTrackColor(data);
            break;
        case RELATED:
            displayRelatedSessions(data);
            break;
        case RESERVATION_STATUS:
            updateReservationStatusAndSeatAvailability(data);
            break;
        case RESERVATION_RESULT:
            updateReservationResult(data);
            break;
        case RESERVATION_PENDING:
            updateReservationPending(data);
            break;
        case RESERVATION_FAILED:
            showRequestFailed();
            updateReservationStatusAndSeatAvailability(data);
            break;
        case RESERVATION_SEAT_AVAILABILITY:
            updateReservationStatusAndSeatAvailability(data);
            break;
        case AUTH_REGISTRATION:
            updateAuthRegistration(data);
            break;
        default:
            break;
    }
}
 

开发者ID:google,
项目名称:iosched,
代码行数:44,
代码来源:SessionDetailFragment.java

示例13: displayErrorMessage

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
@Override
public void displayErrorMessage(SessionDetailQueryEnum query) {
    // Not showing any error
}
 

开发者ID:google,
项目名称:iosched,
代码行数:5,
代码来源:SessionDetailFragment.java

示例14: SessionDetailQueryEnum

点赞 2

import com.google.samples.apps.iosched.session.SessionDetailModel.SessionDetailQueryEnum; //导入依赖的package包/类
SessionDetailQueryEnum(int id, String[] projection) {
    this.id = id;
    this.projection = projection;
}
 

开发者ID:google,
项目名称:iosched,
代码行数:5,
代码来源:SessionDetailModel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)