<commit_before>/*
 * Copyright 2017 <NAME>. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.android.mediasession.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;

import com.example.android.mediasession.R;
import com.example.android.mediasession.client.MediaBrowserAdapter;
import com.example.android.mediasession.client.MediaBrowserChangeListener;
import com.example.android.mediasession.service.contentcatalogs.MusicLibrary;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MS_MainActivity";

    private ImageView mAlbumArt;
    private TextView mTitleTextView;
    private TextView mArtistTextView;
    private ImageView mMediaControlsImage;
    private Button mButtonPlay;
    private Button mButtonPrevious;
    private Button mButtonNext;
    private MediaSeekBar mSeekBarAudio;

    private MediaBrowserAdapter mMediaBrowserAdapter;
    private MediaBrowserListener mMediaBrowserListener;

    // This is used to synchronize the PlaybackProgress and SeekBar so when the user is moving
    // the scrubber on the SeekBar, it doesn't get updated automatically.
    private boolean mUserIsSeeking;

    private boolean mIsPlaying;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initializeUI();
        mMediaBrowserAdapter = new MediaBrowserAdapter(this);
        mMediaBrowserListener = new MediaBrowserListener();
        mMediaBrowserAdapter.addListener(mMediaBrowserListener);
        respondToSeekBarDragByUser();
    }

    private void respondToSeekBarDragByUser() {
        mSeekBarAudio.setOnSeekBarChangeListener(
                new SeekBar.OnSeekBarChangeListener() {
                    int userSelectedPosition = 0;

                    @Override
                    public void onStartTrackingTouch(SeekBar seekBar) {
//                        mUserIsSeeking = true;
                    }

                    @Override
                    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
//                        if (fromUser) {
//                            userSelectedPosition = progress;
//                        }
                    }

                    @Override
                    public void onStopTrackingTouch(SeekBar seekBar) {
//                        mUserIsSeeking = false;
//                        mMediaBrowserAdapter.getTransportControls().seekTo(userSelectedPosition);
//                        mPlaybackProgressListener.seekTo(userSelectedPosition);
//                        Log.d(TAG,
//                                String.format("onStopTrackingTouch: seekTo(%d)",
//                                        userSelectedPosition));
                    }
                });
    }
<commit_msg>Remove code to manage seeking in the Activity.<commit_after>/*
 * Copyright 2017 <NAME>. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.android.mediasession.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;

import com.example.android.mediasession.R;
import com.example.android.mediasession.client.MediaBrowserAdapter;
import com.example.android.mediasession.client.MediaBrowserChangeListener;
import com.example.android.mediasession.service.contentcatalogs.MusicLibrary;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MS_MainActivity";

    private ImageView mAlbumArt;
    private TextView mTitleTextView;
    private TextView mArtistTextView;
    private ImageView mMediaControlsImage;
    private Button mButtonPlay;
    private Button mButtonPrevious;
    private Button mButtonNext;
    private MediaSeekBar mSeekBarAudio;

    private MediaBrowserAdapter mMediaBrowserAdapter;
    private MediaBrowserListener mMediaBrowserListener;

    private boolean mIsPlaying;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initializeUI();
        mMediaBrowserAdapter = new MediaBrowserAdapter(this);
        mMediaBrowserListener = new MediaBrowserListener();
        mMediaBrowserAdapter.addListener(mMediaBrowserListener);
    }

{'fraction_non_alphanumeric': 0.07000486144871172, 'fraction_numerical': 0.00405120725976341, 'mean_word_length': 3.145063801208865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5397381', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1493, 'n_words': 430}