Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 133 lines (108 sloc) 6.113 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
# These are single method callbacks that have been removed in case we need them again
task :removed_callbacks do
  [
    %w(android.opengl.GLSurfaceView.EGLConfigChooser),
    %w(android.opengl.GLSurfaceView.GLWrapper),

    %w(android.media.AudioManager.OnAudioFocusChangeListener), #
    %w(android.media.MediaPlayer.OnBufferingUpdateListener MediaPlayerOnBufferingUpdateListener),
    %w(android.media.MediaPlayer.OnCompletionListener MediaPlayerOnCompletionListener),
    %w(android.media.MediaPlayer.OnErrorListener MediaPlayerOnErrorListener),
    %w(android.media.MediaPlayer.OnInfoListener MediaPlayerOnInfoListener),
    %w(android.media.MediaPlayer.OnPreparedListener MediaPlayerOnPreparedListener),
    %w(android.media.MediaPlayer.OnSeekCompleteListener MediaPlayerOnSeekCompleteListener),
    %w(android.media.MediaPlayer.OnVideoSizeChangedListener MediaPlayerOnVideoSizeChangedListener),
    %w(android.media.MediaRecorder.OnErrorListener MediaRecorderOnErrorListener),
    %w(android.media.MediaRecorder.OnInfoListener MediaRecorderOnInfoListener),
    %w(android.media.MediaScannerConnection.OnScanCompletedListener), #
    %w(android.media.SoundPool.OnLoadCompleteListener SoundPoolOnLoadCompleteListener), #

    %w(android.content.DialogInterface.OnCancelListener DialogOnCancelListener),
    %w(android.content.DialogInterface.OnClickListener DialogOnClickListener),
    %w(android.content.DialogInterface.OnDismissListener DialogOnDismissListener),
    %w(android.content.DialogInterface.OnKeyListener DialogOnKeyListener),
    %w(android.content.DialogInterface.OnMultiChoiceClickListener DialogOnMultiChoiceClickListener),
    %w(android.content.DialogInterface.OnShowListener DialogOnShowListener), #
    %w(android.content.IntentSender.OnFinished IntentSenderOnFinished), #
    %w(android.content.SharedPreferences.OnSharedPreferenceChangeListener),
    %w(android.content.SyncStatusObserver), #

    %w(android.location.GpsStatus.Listener GpsStatusListener),
    %w(android.location.GpsStatus.NmeaListener), #

    %w(android.preference.Preference.OnPreferenceChangeListener),
    %w(android.preference.Preference.OnPreferenceClickListener),

    %w(android.view.View.OnTouchListener),
    %w(android.view.View.OnLongClickListener),
    %w(android.view.View.OnFocusChangeListener),
    %w(android.view.View.OnKeyListener),

    %w(android.speech.tts.TextToSpeech.OnInitListener TextToSpeechOnInitListener), #
    %w(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener TextToSpeechOnUtteranceCompletedListener), #

    %w(android.gesture.GestureOverlayView.OnGesturePerformedListener), #

    %w(android.app.KeyguardManager.OnKeyguardExitResult),
    %w(android.app.PendingIntent.OnFinished PendingIntentOnFinished),
    %w(android.app.SearchManager.OnCancelListener SearchOnCancelListener),
    %w(android.app.SearchManager.OnDismissListener SearchOnDismissListener),
    %w(android.app.DatePickerDialog.OnDateSetListener),
    %w(android.app.TimePickerDialog.OnTimeSetListener),

    %w(android.database.sqlite.SQLiteDatabase.CursorFactory SQLiteCursorFactory),

    %w(java.lang.Runnable),
    %w(android.os.Handler.Callback Handler),

    %w(android.widget.AdapterView.OnItemLongClickListener),
    %w(android.widget.TabHost.TabContentFactory),
    %w(android.widget.TabHost.OnTabChangeListener),
    %w(android.widget.TextView.OnEditorActionListener),
    %w(android.widget.DatePicker.OnDateChangedListener),
    %w(android.widget.TimePicker.OnTimeChangedListener),
  ].each do |c, n|
    # Do something
  end
end

# Generate callbacks
task :callbacks do
  [
    %w(android.opengl.GLSurfaceView.EGLContextFactory), #
    %w(android.opengl.GLSurfaceView.EGLWindowSurfaceFactory), #
    %w(android.opengl.GLSurfaceView.Renderer GLSurfaceViewRenderer),
    %w(android.view.SurfaceHolder.Callback SurfaceHolderCallback),


    %w(android.media.AudioRecord.OnRecordPositionUpdateListener),
    %w(android.media.AudioTrack.OnPlaybackPositionUpdateListener),
    %w(android.media.JetPlayer.OnJetEventListener),
    %w(android.media.MediaScannerConnection.MediaScannerConnectionClient), #

    %w(android.location.LocationListener),

    %w(android.view.GestureDetector.OnDoubleTapListener),
    %w(android.view.GestureDetector.OnGestureListener),
    %w(android.view.ScaleGestureDetector.OnScaleGestureListener), #
    %w(android.view.ViewGroup.OnHierarchyChangeListener),

    %w(android.speech.RecognitionListener), #

    %w(android.gesture.GestureOverlayView.OnGestureListener), #
    %w(android.gesture.GestureOverlayView.OnGesturingListener), #

    %w(android.database.sqlite.SQLiteTransactionListener), #5

    %w(android.widget.AdapterView.OnItemSelectedListener),

    %w(android.hardware.SensorEventListener),
  ].each do |c, n|
    puts `ruboto gen interface #{c} --name Ruboto#{n ? n : c.split(".")[-1]} --force include --package org.ruboto.callbacks`
  end

  # Subclasses with methods added after minSDK
  [
    %w(android.telephony.PhoneStateListener),
    %w(android.database.sqlite.SQLiteOpenHelper),
    %w(android.view.GestureDetector.SimpleOnGestureListener),
  ].each do |c, n|
    puts `ruboto gen subclass #{c} --name Ruboto#{n ? n : c.split(".")[-1]} --method_base on --force exclude --package org.ruboto.callbacks`
  end

  # Subclasses added after minSDK
  [
    %w(android.view.ScaleGestureDetector.SimpleOnScaleGestureListener),
  ].each do |c, n|
    puts `ruboto gen subclass #{c} --name Ruboto#{n ? n : c.split(".")[-1]} --method_base on --force include --package org.ruboto.callbacks`
  end

  [
    %w(android.content.ContentProvider),
  ].each do |c, n|
    puts `ruboto gen subclass #{c} --name Ruboto#{n ? n : c.split(".")[-1]} --method_base abstract --force exclude --package org.ruboto.callbacks`
  end
end

# Generate callback subclasses for widgets
task :widgets do
  ruboto_dir = "../ruboto-core/bin/"
  %w(EditText TextView Button ListView ScrollView SeekBar).each do |c, n|
    puts `ruboto gen subclass android.widget.#{c} --name Ruboto#{n ? n : c.split(".")[-1]} --method_base on --force exclude --package org.ruboto.widget`
  end
end
Something went wrong with that request. Please try again.